activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minglin <>
Subject Some of active consumers have pending messages in prefetch buffers but consume none of them
Date Wed, 24 Jul 2013 09:57:40 GMT
I have a activemq consumer client written using spring JMS. 
It uses a PooledConnectionFactory and DefaultMessageListenerContainer to
pool consumers as follows:
    <bean id="consumerConnectionFactory"
        <property name="maxConnections" value="40"/>
        <property name="maximumActiveSessionPerConnection" value="50"/>
        <property name="connectionFactory">
            <bean class="org.apache.activemq.ActiveMQConnectionFactory">
                <property name="brokerURL" value="${recommend_mqurl}"/>
                <property name="useAsyncSend" value="true"/>

    <bean id="xxxConsumer"
        <property name="recommendCenter" ref="recommendCenter"/>

    <bean id="xxxListener"
        <constructor-arg ref="xxxConsumer"/>
        <property name="defaultListenerMethod" value="handleMessage"/>
        <property name="messageConverter" ref="xxxConverter"/>

    <bean id="recommendCenterDealListenerContainer"
        <property name="connectionFactory" ref="consumerConnectionFactory"/>
        <property name="destination" ref="xxxDestination"/>
        <property name="messageListener" ref="xxxListener"/>
        <property name="concurrentConsumers" value="4"/>
        <property name="maxConcurrentConsumers" value="4"/>
The configuration of "xxxConverter" and "xxxDestination" are omitted here.
N.B. I think it is improper to pool consumers.

And Several copies of the client run on different machines, one running copy
on each machine.
For the broker, I set the prefetch size to 10000.
And when I browsed the "Active Consumers" button in "Views" column of the
web console for the broker, I found several connections from each machine to
the broker, and each connection has several sessions "attached", maybe 1, 2,
etc. Some of "Active Consumers" have 10000 messages enqueue, but 0 dequeue.
You can get some information from the follow snapshots got from web console:

When I browsed the connection above, I got the following information:

I don't know why these "Active Consumers" got the messages from broker to
their prefetch buffers but did not consume any of them.

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message