You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by pollotek <cl...@gmail.com> on 2014/01/02 23:40:23 UTC

Unbalanced message dispatching

I have a non persistent network of brokers composed of 2 brokers and 2
consumers. Consumers are configured to failover connect to broker1 and
broker2 in that order.

I've noticed that when I redeploy my app, which requires the consumers to be
restarted, one of the consumers CPU goes very high (sometimes it reaches
100%) and stays like that until bounced again and the other one goes very
low doing almost nothing. I interpret this as the brokers dispatching all
messages to one of the consumers only and the other one is not getting any
messages.

I can only get the load rebalanced by bouncing both consumers at exactly the
same time. My servers process about 50k messages per minute distributed
across 20 different queues. 

This is my consumer connection factory configuration: 

    <bean id="jmsConnectionFactory"
class="org.jencks.amqpool.PooledConnectionFactory">
        <constructor-arg
value="failover:(tcp://broker01:61616,tcp:broker02:61616)?jms.prefetchPolicy.queuePrefetch=20"/>
        <property name="maxConnections" value="8"/>
        <property name="maximumActive" value="500"/>
    </bean>

On the brokers the only destination policy I have is DQL which seems
completely unrelated:

        <destinationPolicy>
            <policyMap>
                <policyEntries>
                    <policyEntry queue=">">
                        <deadLetterStrategy>
                            <individualDeadLetterStrategy queuePrefix="DLQ."
useQueueForQueueMessages="true" />
                        </deadLetterStrategy>
                    </policyEntry>
                </policyEntries>
            </policyMap>
        </destinationPolicy>

So the brokers should be using the default Round robin dispatch policy. My
whole system is running on Ubuntu 12.04.3 LTS, Java 1.6.0_32 Hotspot 64 and
ActiveMQ 5.6.

How can I make my brokers dispatch messages more evenly to my two consumers?

It would be handy if JMX exposed metrics included messages dispatched per
consumer server. 





--
View this message in context: http://activemq.2283324.n4.nabble.com/Unbalanced-message-dispatching-tp4675961.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.