user1616345
user1616345

Reputation: 31

No new consumers on activemq queue after a while

Since a month we have a reoccurring issue with activemq and spring. After a some time (between a day and a week) we have no more consumers and no new ones get started and the queue starts to fill up.

This setup ran for over a year, without any issues and as far as we can see nothing relevant has been changed.

An other queue we use also started to show the same behavior, but less frequent.

from the activemq webconsole ( as you can see lots of pending messages and no consumers)

Name ↑ Number Of Pending Messages Number Of Consumers Messages Enqueued Messages Dequeued Views Operations
queue.readresult 19595 0 40747 76651 Browse Active Consumers 

contents of our bundle-context.xml

<!-- JMS -->
<bean id="jmsConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory" destroy-method="stop">
    <property name="maxConnections" value="5" />
    <property name="maximumActive" value="5" />

    <property name="connectionFactory">
        <bean class="org.apache.activemq.ActiveMQConnectionFactory">
            <property name="brokerURL">
                <value>tcp://localhost:61616</value>
            </property>
        </bean>
    </property>
</bean>


<bean id="ResultMessageConverter" class="com.bla.ResultMessageConverter" />

<jms:listener-container connection-factory="jmsConnectionFactory" destination-resolver="jmsDestinationResolver"
    concurrency="2" prefetch="10" acknowledge="auto" cache="none" message-converter="ResultMessageConverter">
    <jms:listener destination="queue.readresult" ref="ReaderRequestManager" method="handleReaderResult" />
</jms:listener-container>

There are no exception in any of the logs. Does anyone knows of a reason why after a while no new consumers could be started.

Thanks

Upvotes: 3

Views: 4244

Answers (2)

NoUserException
NoUserException

Reputation: 681

I've run into issues before where "consumers stop consuming," but haven't seen consumers stop existing. You may be running out of memory and/or connections in the pool. Do you have to restart ActiveMQ to fix the problem or just your application?

Here are a couple suggestions:

  1. Set the queue prefetch to 0
  2. Add "useKeepAlive=false" on the connection string
  3. Increase the memory limits for the queues

Upvotes: 2

Petter Nordlander
Petter Nordlander

Reputation: 22279

I can see no obvious reason in the config provided why it should fail. So you need to resort to classic trouble shooting.

Try to set logging to debug and recreate the issue. Then you should be able to see more and you might be able to detect the root cause of it.

Also, check out the JMS exception listener and try to attach it your implementation of it to get a grasp of the real problem.

http://docs.oracle.com/javaee/6/api/javax/jms/ExceptionListener.html

Upvotes: 1

Related Questions