-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.
Description
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;
}
Metadata
Metadata
Assignees
Labels
api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.