java - How activemq wildcard consumers work? -


i using activemq 5.8 wildcard consumers configured in camel route.

i using default activemq configuration, have defaults below

prefetch = 1 dispatch policy= round robin 

now start consumer jvm 5 consumers each 2 queues. both queue has same type of message , same number of messages.

consumers doing nothing printing message (so no db blocking or slow consumer issue)

edit have set prefetch 1 each of queue

what observe 1 of queue getting drained faster other.

what expect both queue getting drained @ equal pace, kind of load balance.

one surprising observation though activemq webconsole shows 5 consumers each of queues

enter image description here

when debug consumer, see 5 threads / consumers camel flow wildcard queue *.processqueue enter image description here

what cause of above behavior? how make sure queue drain @ equal pace?

did has experience share on writting custom dispatch policy or overriding defaults of activemq?

i able find reference behavior

message distribution in case of wildcard queue consumers random.

http://activemq.2283324.n4.nabble.com/wildcard-and-message-distribution-td2346132.html#a2346133

though can tuned setting appropriate prefetch size.

after trial & error, arrived @ following formula, have fair distribution across consumers , queue getting de-queued @ same pace.

prefetch = number of wildcard consumers 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -