Announcement Announcement Module
Collapse
No announcement yet.
Message Listeners stop consuming messages Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Message Listeners stop consuming messages

    Hi

    I have a strange issue where consumers stop working after one message is consumed. Once all the concurrent consumers have consumed there 1st message it stops receiving messages. I see the messages on the queues and i am constantly publishing them to the exchange.

    I when i have 5 concurrent consumers i can see 5 messages consumed and it stops then. When i increase my concurrent consumers to 10 it consumes 10 messages and stops receiving any more messages.

    I see the threads are waiting for new messages but non is getting pulled from the queue. I have a standard configuration as follows.


    Code:
    	<bean id="accountMsgListenerContainer" class="org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer">
    		<property name="connectionFactory" ref="connectionFactory" />
    		<property name="queueName" value="#{account.name}" />
    	    <property name="concurrentConsumers" value="5" />
    	    <property name="messageListener" ref="accountMsgListenerAdapter" />
    	    <property name="autoAck" value="true"/>
    	    <property name="errorHandler" ref="errorHandler" />
    	</bean>
    
    	<bean id="accountMsgListenerAdapter" class="org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter">
    		<property name="delegate" ref="accountMessageHandler" />
    		<property name="defaultListenerMethod" value="handleMessage"/>
    		<property name="messageConverter" ref="simpleMessageConverter"/>
    	</bean>
    Please let me know your thoughts? any fix for this would be greatly appreciated.

    Hetti

  • #2
    Turn on error handling

    I would recommend setting the logging for the spring-amqp classes to debug.

    I had a similar problem and by changing my log4j.xml to allow for SimpleMessageListenerContainer to log at a debug level, I found that I had a runtime error getting thrown back to the spring-amqp stuff, which that code catches and explicitly shuts down the listeners.

    Comment


    • #3
      Thanks for the reply. I changed the log level to debug on Spring AMPQ still i see the 5 consumers consume one message each and then stop consuming. The logs are clean and i see 5 DEBUG messages from the SimpleMessageListenerContainer for the 5 messages that it consumed. No errors

      Comment


      • #4
        Can you post your log4j.xml config, spring config, and the log file output?

        Comment


        • #5
          By the way you had created a ticket for this issue. Is this for this particular issue. Can you provide the JIRA id.

          Log4j settings
          Code:
          log4j.rootLogger=WARN, R 
          log4j.appender.R=org.apache.log4j.RollingFileAppender 
          log4j.appender.R.File=${catalina.base}/logs/logs.log 
          log4j.appender.R.MaxFileSize=10MB 
          log4j.appender.R.MaxBackupIndex=10 
          log4j.appender.R.layout=org.apache.log4j.PatternLayout 
          log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
          
          log4j.logger.org.springframework=WARN
          log4j.logger.org.springframework.integration=WARN
          log4j.logger.org.springframework.amqp=DEBUG
          Log output...

          Code:
          2010-12-27 15:24:28,519 [SimpleAsyncTaskExecutor-3] DEBUG org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer - Received message from exchange [admin.ChannelVerification.Topic], routing-key [admin.verify.channel.email]
          2010-12-27 15:24:28,544 [SimpleAsyncTaskExecutor-3] DEBUG com.admin.esb.message.handler.ChannelVerificationMessageHandler - Email verification request recieved. About to send for verification. Email Address [email protected] verification code 233*b971ba31-27a6-4ccf-a018-e61a3fbe0f31 channelId 233
          2010-12-27 15:25:18,497 [SimpleAsyncTaskExecutor-4] DEBUG org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer - Received message from exchange [admin.ChannelVerification.Topic], routing-key [admin.verify.channel.email]
          2010-12-27 15:25:18,501 [SimpleAsyncTaskExecutor-4] DEBUG com.admin.esb.message.handler.ChannelVerificationMessageHandler - Email verification request recieved. About to send for verification. Email Address [email protected] verification code 233*b971ba31-27a6-4ccf-a018-e61a3fbe0f31 channelId 233
          2010-12-27 15:26:08,506 [SimpleAsyncTaskExecutor-2] DEBUG org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer - Received message from exchange [admin.ChannelVerification.Topic], routing-key [admin.verify.channel.email]
          2010-12-27 15:26:08,510 [SimpleAsyncTaskExecutor-2] DEBUG com.admin.esb.message.handler.ChannelVerificationMessageHandler - Email verification request recieved. About to send for verification. Email Address [email protected] verification code 233*b971ba31-27a6-4ccf-a018-e61a3fbe0f31 channelId 233
          2010-12-27 15:26:58,510 [SimpleAsyncTaskExecutor-5] DEBUG org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer - Received message from exchange [admin.ChannelVerification.Topic], routing-key [admin.verify.channel.email]
          2010-12-27 15:26:58,511 [SimpleAsyncTaskExecutor-5] DEBUG com.admin.esb.message.handler.ChannelVerificationMessageHandler - Email verification request recieved. About to send for verification. Email Address [email protected] verification code 233*b971ba31-27a6-4ccf-a018-e61a3fbe0f31 channelId 233
          2010-12-27 15:27:48,518 [SimpleAsyncTaskExecutor-1] DEBUG org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer - Received message from exchange [admin.ChannelVerification.Topic], routing-key [admin.verify.channel.email]
          2010-12-27 15:27:48,521 [SimpleAsyncTaskExecutor-1] DEBUG com.admin.esb.message.handler.ChannelVerificationMessageHandler - Email verification request recieved. About to send for verification. Email Address [email protected] verification code 233*b971ba31-27a6-4ccf-a018-e61a3fbe0f31 channelId 233

          Comment


          • #6
            Are you sure you are exiting from the message correctly? It looks like each thread is never actually finishing it's work in it's first message, which is why it never goes back for another.

            You might try explicitly putting a return into the end of whatever code you have that is processing the message. That will help force the thread to realize it's done. But you might also just add some additional logging on your side to see if you are just never completing any given process.

            Comment


            • #7
              I will check this. Thanks for the update.

              Comment


              • #8
                I resolved it by making sure the thread returns. The problem was spring integration reply thread was in limbo. Thanks for the support.

                Comment


                • #9
                  I believe you had discussed the same issue on a different forum thread within the Spring Integration section. If so, could you please post the link to that thread here for reference?

                  Thanks,
                  -Mark

                  Comment


                  • #10
                    http://forum.springsource.org/showthread.php?t=99780

                    Comment

                    Working...
                    X