Skip to content
New issue

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

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

Already on GitHub? # to your account

Unable to create multiple consumers for different topics in the same process? #1313

Open
mango009 opened this issue Oct 6, 2024 · 3 comments

Comments

@mango009
Copy link

mango009 commented Oct 6, 2024

I create multiple consumers running in different Go routines. These consumers consume messages on different topics.

But I notice that when one consumer is blocked processing messages, the other consumer would get timeout error on the ReadMessage function.

Is it not a practice to create multiple consumers in the same process?

@OneCricketeer
Copy link

Does each routine run one consumer group?

One consumer can already subscribe to a regex pattern of topic names.

Sub-processing is an alternative solution than coroutines

@mango009
Copy link
Author

Yes. Each consumer group run in it's own go routine. I know alternative is to subscribe multiple topic in one go routine. But the API doesn't preclude subscribing one topic in separate go routine. And if this is a bad practice it would helpful to state this in the document (and maybe give a reason).

@OneCricketeer
Copy link

Can you please share an example? Also, do they all share a config? Specifically all a single group.id

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants