Spring cloud stream - concurrency

Hi there

I'm trying to configure more than one Consumer Thread for my functional consumer

But I saw that when I config concurrency as 5. It will create 5 session connection to the solace server.

when config concurrency is 5. It will create 5 session connection to the solace

when config concurrency is 10. It will create 10 session connection to the solace

is it the bug?

Comments

  • giri
    giri Member, Administrator, Employee Posts: 103 admin
    edited October 2022 #2

    Hi @tuancris92,

    It is not a bug. The concurrency setting is meant for creating concurrent consumer flows to consume messages from the queue. Note that the group's queue must have been non-exclusive (default if not specified) - that's how it supports multiple consumers on the queue. More info can be found in the Spring Cloud Stream binder docs.

    If you want to create multiple consumers connecting to the same queue, consider multiple instances of the same application with a single consumer session.

    [EDIT] Concurrency implies the number of flows created in a session - not concurrent session.

  • tuancris92
    tuancris92 Member Posts: 3

    Hi @giri , Thank you for your answer. Do you have any problem if have a lot of session connections to the solace server?

  • giri
    giri Member, Administrator, Employee Posts: 103 admin

    No, it is something configurable on the queue. Using CLI or Solace Broker manager, you can set this limit on the queue.


  • tuancris92
    tuancris92 Member Posts: 3
    edited October 2022 #5

    But if have a lot of connection sessions to solace MQ, do they make the solace MQ slow? Do we have a document talk about this? @giri

  • giri
    giri Member, Administrator, Employee Posts: 103 admin
    edited October 2022 #6

    Solace queue supports up to 10000 with a default of 1000 consumer flows per queue.

    I would also recommend reading this thread that goes into this and related topics https://solace.community/discussion/1471/parallel-processing-of-messages-by-solace

    And a blog on consumer scaling https://solace.com/blog/consumer-groups-consumer-scaling-solace/

    Note that the topic we are discussing is general Solace Queue consumers and scaling - this applies to Solace queue access via any APIs and frameworks.