I am using solace spring cloud stream apis to consume messages from a queue to a function. I would like to know how can I make it multi threaded using multiple message listeners(consumers) to the same queue so that I can process all the messages quickly. Concurrency property is not working, can you please give an example of a yml filewith proper use of concurrency property
Hi,
Did you set your queue to “non-exclusive” access mode? If that’s set to “exclusive” only one of your instances will receive messages, the other will be on “stand-by”. To achieve round robin to multiple consumer you will have to set “non-exclusive”.
Leah has blogged about this here … https://solace.com/blog/solace-message-queue-access-types/
Thank you for your reply. The queue is already created as non-exclusive. Just wanted to see a sample yml file with concurrency property is set correctly. Right now, the consumer function is not fast enough. For eg. if we have 100 messages in the queue and if configure concurrency as 3, I am assuming it will automatically have 3 consumers so that all 100 messages can be processed in a faster way compared to the default set up with only 1 consumer.
Hi @matthesu,
Thanks for asking this. I would have expected the concurrency
property to work as well. I’ll look into it and let you know what I find.
-Marc
@matthesu when I tested this out I’m seeing the same thing as you. I’ve opened an issue here to track this: SCSt Binder Doesn't Seem to support concurrency Consumer Property · Issue #7 · SolaceProducts/solace-spring-cloud · GitHub and will try to remember to respond to this thread as well when there are any updates
Hey @matthesu ,
Just a heads up that support for concurrency will be in the next release and a PR is available here if you want to check it out before it’s officially released.
-Marc