Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Publisher : Lifetime of the publisher object (Pubsub) #2342

Copy link
Copy link

Description

@hmigneron
Issue body actions

When using the pubsub java client, how long should a Publisher object live for ?

In a scenario where we get frequent HTTP requests that get translated into Pubsub messages, doing

try {
    publisher = Publisher.defaultBuilder(topic).build();

    //... do publish stuff
}
finally { 
    if (publisher != null) {
        publisher.shutdown();
    }
}

each time seems inefficient. I couldn't find any documentation on the expected lifetime of the object.

How often should the publisher be shutdown (either in terms of time or messages published) ?

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.