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
when debug consumer, see 5 threads / consumers camel flow wildcard queue *.processqueue
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
Post a Comment