java - RabbitListener multiple queues behavior -


what behavior when using following construct (latest version of spring). i'm unable find in documentation.

@rabbitlistener(queues = {"q1", "q2", "q3"}) public class mylistener { 

in order messages 3 queues processed?

it indeterminate - 3 basicconsume operations performed on consumer channel (if increase concurrentconsumers it's 3 per consumer). basicconsume operations performed in order queues defined (in cases unless 1 or more of queues temporarily "missing").

the broker send messages each queue prefetchcount (basicqos) each queue (default 1).

i don't know actual algorithm used broker in scenario should assume indeterminate - spring amqp deliver them listener(s) in order received broker.

edit

i ran test (2 queues each 2 existing messages) , delivered round-robin - q1m1, q2m1, q1m2, q2m2 when prefetch 1.

with prefetch set 4, see q1m1, q1m2, q2m1, q2m2.

of course, when queues empty, messages arrive in order arrive @ broker.

edit2

see consumer prefetch.

spring amqp uses basicqos variant no global arg, default (false) used. means prefetch per-consumer.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -