Announcement Announcement Module
No announcement yet.
How many no of rabbitmq listeners we can configure? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How many no of rabbitmq listeners we can configure?

    Hi all,

    I am new to RabbitMQ with Spring AMQP,Presently I am consuming messages in Asynchronous way using Listeners,In my configuration now there are 5 listeners each one is executing a different task,In future it may be increased based on business criteria,Here my question is, how many no of listeners we can up to put,this app is deployed in tcserver.code as follows,
            <rabbit:listener-container acknowledge="manual" channel-transacted="true">
    		<rabbit:listener queues="questionAssignmentDetails" ref="questionAssignmentDetailsListener"/>
    		<rabbit:listener queues="updateResourceAssignments" ref="updateResourceAssignmentListener"/>
    		<rabbit:listener queues="questionUpdateResource" ref="questionUpdateResourceListener"/>
    		<rabbit:listener queues="questionAssignmentRequest" ref="questionAssignmentRequestListener"/>
    		<rabbit:listener queues="responderAssignmentResource" ref="responderAssignmentResourceListener"/>
    Any help is appreciated,
    Thanks in advance.

  • #2
    Each listener has 1 thread or N threads if you set the concurrent-consumers value to N. That's the main factor.

    You *can* however share a listener for multiple queues (specify a comma-delimited list for the queues attribute), but that would require having the messages from each of those queues passed to a single method (where perhaps you do some basic 'routing' or add conditional logic depending on the type/source of each message).


    • #3
      Thanks Mark,

      I have Understood this clearly,but my doubt here is,If number of listeners increased in app,how it manages the server(tcserver as well as RabbitMQ),is there any limitation for creating listeners,How things going when rabbit:listener came into picture,could you please explain clearly.

      Thanks in advance.


      • #4
        No; there is no limit; just add as many listeners as you want, and each one can have as many threads (controlled by the 'concurrency' attribute) as you want.

        At some point, however, depending on your needs, you may decide to consolidate listeners - reduce the number of listeners, and have each one listen on more than one queue - then the available threads will be shared across the queues.


        • #5
          Thanks Gary,

          Now my doubt is clear.Thanks to spring team once again..