2 Replies Latest reply on Apr 27, 2010 4:31 AM by Sébastien Gérard

    Infinite Redelivery

    Sébastien Gérard Newbie

      Hello !

       

      I'm here because of a redelivery problem. I've tryed on Jboss 4.2.0 ou 4.2.3 with Spring 2.5.6. Unfortunately, Jboss seems to not handle correctly the RedeliveryLimit attribute. Thanks to JMX, I can see that the RedeliveryLimit for my configured queue is set to -1 (i.e., no limit). Even if I set that attribute to 3, the behaviour is the same: my listener continuously receives the message (on message is called again & again) and throws a runtime exception every time it receives the message. The message is never placed in the DLQ. Changing the redelivering delay,rightly delays  the reception  of my messages. Here is the configuration of my queue:

       

       

         <mbean code="org.jboss.mq.server.jmx.Queue"
                  name="jboss.mq.destination:service=Queue,name=com.bsb.sf.incubator.jms.queueA">
               <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>-->
               <atttribute name="RedeliveryLimit">3</atttribute>
           </mbean> 

       

       

      My spring message listener:

       

           <bean id="jmsContainer">
               <property name="concurrentConsumers" value="3"/>
               <property name="messageListener" ref="exceptionMessageListenerQueueA"/>

       

              <property name="destinationName" value="queueA" />
               <property name="destinationResolver" ref="destinationResolver" />
               <property name="sessionTransacted" value="true"/>

       

              <property name="connectionFactory" ref="connectionFactory" />
           </bean>

       

       

       

      Here is my listenener:

           public void onMessage(Message message) {
               boolean isSuccessfullyReceived = false;
               try {
                   if ( throwingPolicy != null )
                   {
                       throwingPolicy.throwExceptionIfRequired(message, this);
                   }
                   isSuccessfullyReceived = true;
               } finally {
                   final String messageId = messageIdentifierService.getMessageIdentifier(message);
                   if (isSuccessfullyReceived) {
                       logger.debug("Message [" + message + "] has been successfully received.");
                       onCompleted(messageId, message);
                   } else {
                       logger.debug("Message [" + message + "] has NOT been successfully received.");
                       onException(messageId, message);
                   }
               }
           }

       

       

      Any idea ?

       

      Thanks for your help !