开发者

ActiveMQ + Spring + DefaultMessageListenerContainer - Extremely poor performance

I have a DefaultMessageListenerContainer setup with the following configuration:

threadServiceListenerContainer(org.springframework.jms.listener.DefaultMessageListenerContainer) {
        maxConcurrentConsumers = 10
        concurrentConsumers = 1
        destinationName = 'releaseThread'
        pubSubDomain = false
        connectionFactory = ref("connectionFactory")
        messageListener = ref('threadServiceMessageListener')
    }

There are 3000 backlogged messages sitting in the broker. The consumption rate seems to be 2/sec. I've attached JProfiler to the Java node, but it seems the 10 listener threads/consumers are sitting idle at worst, or operating at 1-at-a-time at best.

The consumer processing time does not register with JProfiler. The consumer just adds a value to memcached, and memcached is operating healthily.

It seems that my consumer is just... sitting there...

Any thoughts? I've rebooted the broker, no performance difference. I've rebooted the node, no performance difference.

I'm injecting Map into the broker.

Here's my connectionfactory bean:

connectionFactory(org.springframework.jms.connection.CachingConnectionFactory, ref("amqConnectionFactory")) {
        exceptionListener = {com.zipwhip.jms.JmsExceptionListener jmsExceptionListener -> }
        sessionCacheSize = 100
    }
    amqConnec开发者_如何学编程tionFactory(org.apache.activemq.ActiveMQConnectionFactory) {
        brokerURL = 'tcp://localhost:61616'
    }


I'd recommend trying couple of things: set producer flow control to false and change dispatch policy. Try to change either or both to see if it helps. We've had our share of performance problems with ActiveMQ (running embedded with OpenEJB) but finally got everything running smoothly.

To change these using activemq.xml use this:

<destinationPolicy>
            <policyMap>
                <policyEntries>
                    <policyEntry queue=">" producerFlowControl="false" enableAudit="false" >
                        <dispatchPolicy>
                            <roundRobinDispatchPolicy />
                        </dispatchPolicy>
                    </policyEntry>
                </policyEntries>
            </policyMap>
</destinationPolicy>

Also, we upgraded from ActiveMQ 4.x to 5.3.1 and we switched from JDBC/journaled persistence to KahaDB persistence.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜