GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Publish does not work when credential JSON is provided · Issue #2426 · googleapis/google-cloud-java

Publish does not work when credential JSON is provided #2426

New issue
Copy link
New issue
Copy link
Closed
Closed
Publish does not work when credential JSON is provided#2426
Copy link
Assignees
pongad
Labels
api: pubsubIssues related to the Pub/Sub API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.triaged for GAtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@karikalankumaresan
karikalankumaresan
opened on Sep 11, 2017
Issue body actions

The following code works fine when deployed to the app engine flexible environment and calls the relevant /push endpoint.

Publisher publisher = null;
try {
   publisher = Publisher.defaultBuilder(topic).build();
   ByteString data = ByteString.copyFromUtf8("my-message");
   PubsubMessage pubsubMessage = PubsubMessage.newBuilder().setData(data).build();
   ApiFuture<String> messageIdFuture = publisher.publish(pubsubMessage);
 } finally {
   if (publisher != null) {
     publisher.shutdown();
  }
}             

However, when changed the "publisher" instantiation to the following (using the JSON), the publish code executes fine, but the /push endpoint is not called.

    Resource resource = new ClassPathResource("xxxx.json");
    final InputStream inputStream = resource.getInputStream();
    CredentialsProvider credentialsProvider = FixedCredentialsProvider.create(
		    ServiceAccountCredentials.fromStream(inputStream));

    publisher = Publisher.defaultBuilder(TopicName.create("microservice-qa", "testtopic1"))
	    .setCredentialsProvider(credentialsProvider)
	    .build();

Any idea on why this is the case?

Activity

  1. shinfan
    added
    api: pubsubIssues related to the Pub/Sub API.
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Sep 14, 2017
  2. shinfan
    assigned
    neozwu
    on Sep 14, 2017
  3. shinfan commented on Sep 14, 2017

    @shinfan
    shinfan
    on Sep 14, 2017
    Contributor
    More actions

    @neozwu Looks like an issue running on GAE. Can you take a look?

  4. lesv commented on Sep 20, 2017

    @lesv
    lesv
    on Sep 20, 2017
    Contributor
    More actions

    GAE Flex

  5. danoscarmike
    added
    release blocking
    triaged for GA
    on Jan 11, 2018
  6. pongad
    assigned
    pongad
    and unassigned
    neozwu
    on Jan 18, 2018
  7. pongad commented on Jan 18, 2018

    @pongad
    pongad
    on Jan 18, 2018
    Contributor
    More actions

    I verified that this works as intended as of latest release.

    The publish method returns Future<String> without actually waiting for the message to be published. You can try calling publish(pubsubMessage).get() which will wait for the message to be published and return the message ID or throws an exception explaining why the message cannot be published. That should give us more information to go with. Perhaps your service account doesn't have the right permissions etc.

    Due to age of this issue, I'll close it for now. Please reopen if required.

  8. pongad
    closed this as completedon Jan 18, 2018
  9. theacodes
    unassigned
    pongad
    on Sep 28, 2018
  10. JustinBeckwith
    assigned
    pongad
    on Feb 1, 2021
  11. chingor13
    added 2 commits that reference this issue on Feb 20, 2026

    deps: update dependency org.json:json to v20240303 (#2426)

    2accca7

    chore(main): release 3.3.0 (#2415)

    023df3b
  12. chingor13
    added a commit that references this issue on Mar 30, 2026

    chore(benchmarking): Remove retries and switch to publishing api_late…

    97408f4
  13. meltsufin
    added 2 commits that reference this issue on Apr 29, 2026

    chore: Update generation configuration at Thu May 15 02:33:12 UTC 2025 (

    3713edb

    chore: Update generation configuration at Thu May 15 02:33:12 UTC 2025 (

    9f09954
  14. benjaminp
    added a commit that references this issue on Jul 13, 2026

    chore: make library generation required (googleapis#2426)

    99b1089
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @pongad
    pongad

Labels

api: pubsubIssues related to the Pub/Sub API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.triaged for GAtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.