Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PubSub not returning any instance. #1510

Closed
vaibhavsw opened this issue Jan 6, 2017 · 13 comments
Closed

PubSub not returning any instance. #1510

vaibhavsw opened this issue Jan 6, 2017 · 13 comments
Assignees
Labels
api: pubsub Issues related to the Pub/Sub API.

Comments

@vaibhavsw
Copy link

I'm using Cloud PubSub and trying to get access to the PubSub locally using Service Account JSON credential, but it is not returning anything. Below is the code I'm using to get PubSub instance. Neither it is throwing any exception nor it is returning any PubSub instance. This is an issue which needs to be resolved urgently, anyone can help me.

private PubSub getPubSubForLocal() {

        PubSub pubSub = null;
        InputStream inputStream = getClass().getResourceAsStream("/cloud/vostics-cloud-e56ac878e27e.json");
        try {
            pubSub = PubSubOptions.newBuilder()
                    .setCredentials(ServiceAccountCredentials.fromStream(inputStream))
                    .build()
                    .getService();

        } catch (IOException e) {
            return null;
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        return pubSub;
    }

@garrettjonesgoogle
Copy link
Member

Is it throwing an IOException? Your code converts that to null.

@vaibhavsw
Copy link
Author

vaibhavsw commented Jan 6, 2017

@garrettjonesgoogle It is not throwing any exception either.

@vaibhavsw
Copy link
Author

vaibhavsw commented Jan 6, 2017

@garrettjonesgoogle Also, in other application it gives an error with code 443.

@garrettjonesgoogle
Copy link
Member

So I think I need to understand what you mean by "it is not returning anything." Only one of the following is possible:

  1. The return value is null
  2. The return value is a PubSub object
  3. An exception is thrown
  4. The JVM crashes such that the function didn't return

Which of those is happening?

@vaibhavsw
Copy link
Author

vaibhavsw commented Jan 7, 2017

@garrettjonesgoogle Alright, this may sound weird because it does to me.

I've two applications in place and to make them communicate with each other I'm using PubSub, above code is common in both of the application to get an instance of PubSub. In one application it is giving below error:

07-Jan-2017 12:48:56.238 INFO [RMI TCP Connection(3)-127.0.0.1] io.grpc.internal.ManagedChannelImpl.<init> [ManagedChannelImpl@1d98cfab] Created with target pubsub.googleapis.com:443

In another application it is not returning anything, now when I'm saying it is not returning anything by that I mean that it is neither throwing any exception nor returning PubSub object.

I've tried debugging my code and when executing the code, IDE never reaches to any of the exception part.

@vaibhavsw
Copy link
Author

@garrettjonesgoogle Can you help me, I need to resolve this ASAP.

@garrettjonesgoogle
Copy link
Member

Ok I think I should have included another possibility:

  1. One of the function calls hangs, so it never returns.

Can you use your debugger to step into the google-cloud-java code to see more specifically where it is hanging?

@vaibhavsw
Copy link
Author

vaibhavsw commented Jan 10, 2017

@garrettjonesgoogle I've solved the previous issue, but now whenever I'm trying to get the topic or create the topic, it is giving me an error saying DEADLINE_EXCEDDED.

@garrettjonesgoogle
Copy link
Member

  1. I'm curious to know if you can say what caused your issue, in case others come across it.
  2. Generally DEADLINE_EXCEEDED is caused by the static netty-tcnative dependency not loading. See DEADLINE_EXCEEDED when using Cloud Pub/Sub library from Compute Engine #1430 for one particular example. I would need to know more about your environment to help you with that. Could you also turn on FINE logging and provide the library loading errors you see?

@garrettjonesgoogle garrettjonesgoogle added the api: pubsub Issues related to the Pub/Sub API. label Jan 11, 2017
@vaibhavsw
Copy link
Author

@garrettjonesgoogle

  1. It was the issue with my classpath, input stream wasn't able to find the JSON file.
  2. I've added nitty-all dependency in my project, but still error is there.

@garrettjonesgoogle
Copy link
Member

@vaibhavswarnkar In order to help with # 2, could you provide the details of your environment (exact OS version & setup in particular), and errors that you see when you set the logging level to FINE?

@vaibhavsw
Copy link
Author

@garrettjonesgoogle My problem has been solved. I changed my Spring MVC app to Spring boot app and even after that it wasn't working then I changed the server to jetty server and it worked.

@garrettjonesgoogle
Copy link
Member

Great! Closing out issue now.

github-actions bot pushed a commit that referenced this issue Oct 4, 2022
🤖 I have created a release *beep* *boop*
---


## [2.3.15](https://togithub.com/googleapis/java-bigquerydatatransfer/compare/v2.3.14...v2.3.15) (2022-10-03)


### Dependencies

* Update dependency cachetools to v5 ([#1511](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1511)) ([b95ccc8](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/b95ccc8d07c7fc5b6f50917560304bf7d1db8b02))
* Update dependency certifi to v2022.9.24 ([#1497](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1497)) ([8280ad9](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/8280ad9d94f44c41dbc57aef7007359fa43a65ec))
* Update dependency charset-normalizer to v2.1.1 ([#1501](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1501)) ([7f61538](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/7f6153862f189554d10b82b755dcccb9f24c3044))
* Update dependency click to v8.1.3 ([#1502](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1502)) ([d315f8e](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/d315f8e433a64f1a1e4673688991b807285f5435))
* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.4 ([#1523](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1523)) ([5eb622d](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/5eb622d8bcf05a9852c342a73d119e4d703a0c27))
* Update dependency com.google.protobuf:protobuf-java-util to v3.21.7 ([#1521](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1521)) ([7bb94b7](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/7bb94b735d7822337f5f6b671b425081f4822813))
* Update dependency gcp-releasetool to v1.8.8 ([#1498](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1498)) ([9801601](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/9801601eacc79432efa9ce243af8bda87bdeadb2))
* Update dependency google-cloud-core to v2.3.2 ([#1499](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1499)) ([1e73bff](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/1e73bfffe09f8ae7f5216e8e4cd3e7d4aa520893))
* Update dependency googleapis-common-protos to v1.56.4 ([#1500](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1500)) ([3b4b24c](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/3b4b24ccff9a199f78c8e48ea73e7c04f4e2bb5e))
* Update dependency jinja2 to v3.1.2 ([#1503](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1503)) ([4864061](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/48640616122833134b28e42bc689109849a77279))
* Update dependency keyring to v23.9.3 ([#1504](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1504)) ([cc523de](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/cc523de50fefe993dbfbedbebbbd5a9754071342))
* Update dependency markupsafe to v2.1.1 ([#1505](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1505)) ([1e0ba5e](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/1e0ba5e094f98858affb53f77ceb61eff677b7cd))
* Update dependency protobuf to v3.20.2 ([#1506](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1506)) ([7a1e267](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/7a1e267ce2a02b9c506769de09bfefc76d103cb8))
* Update dependency protobuf to v4 ([#1512](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1512)) ([12c0c67](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/12c0c67819a05f4bafab1c280fd3a8b15ee0193b))
* Update dependency pyjwt to v2.5.0 ([#1507](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1507)) ([98f2d58](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/98f2d580e1a78aeeebbbc5db8d2b99461255b86f))
* Update dependency requests to v2.28.1 ([#1508](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1508)) ([9906ca8](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/9906ca8c8a67390106b524d561f1e973126aecfa))
* Update dependency typing-extensions to v4.3.0 ([#1509](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1509)) ([2d7eb9f](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/2d7eb9f93181fbf183ae2d633fdc63748c82110e))
* Update dependency zipp to v3.8.1 ([#1510](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1510)) ([dd98eef](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/dd98eef23cdbac8b9c365504c2456776bed786a9))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API.
Projects
None yet
Development

No branches or pull requests

2 participants