Hi all! I am looking into the thread config of th...
# general
d
Hi all! I am looking into the thread config of the pulsar client. I found this: https://stackoverflow.com/questions/56954771/apache-pulsar-iothreads-listenerthreads-and-message-ordering Please confirm if I am right here. Let's say I use the following code and call it three times to initiate 3 consumers in a kube pod (different topic names, though).
Copy code
pulsarClient
            .newConsumer(schema)
            .topic(topic)
            .subscriptionName(subscription)
            .subscriptionType(SubscriptionType.Shared)
            .messageListener(messageListener)
            .subscribe()
and my client is initiated like so
Copy code
PulsarClient.builder().serviceUrl(pulsarClientUrl).build()
Then there is only 1 thread in which all 3 consumers are going to consume messages from their respective topics, right? Assuming I have the requisite CPU cores allocated, would I then see performance improvement in doing the following:
Copy code
PulsarClient.builder().serviceUrl(pulsarClientUrl).listenerThreads(3).build()
PS: Sorry if this has been asked before; I am not able to search for older conversations where this would have been answered!
Could someone confirm/deny this please?
@merlimat, I see that you had answered the SO question. Would you be able to weigh in here please?
l
@Daniel we are currently directing questions to GitHub Discussions. This is also in the channel header.
If you have a question, please consider asking it at https://github.com/apache/pulsar/discussions/new?category=q-a. It will make it searchable by others.
This channel's chat history can be found at https://www.linen.dev/s/apache-pulsar/c/general.
Please first ask your question on GitHub discussions and then promote the question here. That will help us build a knowledge base over time.
d
Got it! Will do so. Thank you!
I have raised the query in discussions. -- https://github.com/apache/pulsar/discussions/22375
l
thanks, great question. I provided an answer and also introduced another way to achieve better performance. https://github.com/apache/pulsar/discussions/22375#discussioncomment-8938633
gratitude thank you 1