-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Publisher : Lifetime of the publisher object (Pubsub) #2342
Comments
We recommend keeping it around for the lifetime of your process since it has non-trivial startup overhead. |
OK thank you. Considering the process might live for a very long time in our case (multiple days), should we schedule period shutdowns to keep things safe or is that not even necessary ? |
You shouldn't have to schedule periodic shutdowns - we would consider it a bug if that was necessary. |
Thank you very much for your answers ! |
Sorry to resurrect a closed thread. @garrettjonesgoogle Now that AppEngine Standard Java 8 is GA, what's the recommended approach for using PubSub during an AppEngine request and ensuring prompt publishing, is it along the lines of:
Are special considerations needed for the |
Assigning to @pongad for him to answer. |
I'm quite rusty on AppEngine. @jabubake Please let me know if I got anything wrong. Regarding threads, I believe threads still cannot be created "normally". So you need to call If you set Jisha, I believe we talked a while back about creating a doc or sample app for pubsub on GAE; has this happened? @hienle-hps Your referring to @garrettjonesgoogle I think this should be fixed in |
@hienle-hps is a basic example. For a long living publisher, either one that is instantiated within the servlet or as a would be useful. Given you intend to block the request thread, as pongad@ pointed out, |
Thanks for the examples and clarification! |
It looks like the question is resolved, so I'll close the issue. Please reopen if required. |
But what If I want to maintain two publisher with different topic names, then each publisher will create a new ManagedChannelOrphanWrapper and then do the check. Isn't it gonna cause an issue? |
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
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) ?
The text was updated successfully, but these errors were encountered: