Skip to content

Should Publisher be shudown everytime ? #4628

@ayushj158

Description

@ayushj158

I have multiple scheduler which synchronize different kinds of data to different topics every 1 min.
Since my scheduler runs every 1 min either i have to either create an publisher on each invocation(and shutdown) of scheduler or i can maintain publisher as an spring bean and reuse the same.

Can you suggest which is better approach, cause i do see Deadline_Exceeded error intermittently ?

  • Although i know primary cause of Deadline_Exceeded is due to clogging pub sub client with too many messages but could this also impact it ?

Also i read in one of the issues #1751 if we do no call shutdown on publisher it does not exit from JVM and threads are still alive . Which threads are these , thread used by RPC to publish each message ?

  • Basically if i am publishing 100 messages then 100 threads are alive ?

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions