1 Reply Latest reply on Apr 15, 2009 9:00 AM by rchristy

    JBoss/ActiveMQ Messages never delivered to MDB

    rchristy Newbie

      I have a very simple MDB (I am using JBoss 4.2.2 and ActiveMQ 5.,1 and 5.2 both have same behavior) that just consumes messages and throws them away. I can easily reproduce a scenario where I load 100 messages on the queue, 1 to 3 messages will never be delivered to the my MDB. If I stop/start the MDB, they get delivered fine. I tried moving to ActiveMQ 5.2 (I originally was 5.1) and I see the exact behavior. I can also reproduce the same issue but stopping the MDB, loading the messages on the queue, then starting the MDB. Again, messages that never get delivered.

      Is there something wrong with this example?

      @MessageDriven(activationConfig =
      {
      @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
      @ActivationConfigProperty(propertyName="destination", propertyValue="mylilmdb.test.queue"),
      @ActivationConfigProperty(propertyName="maximumRedeliveries", propertyValue="0"),
      @ActivationConfigProperty(propertyName="acknowledgeMode", propertyValue="Auto-acknowledge")
      })
      @ResourceAdapter("activemq-rar.rar")
      @PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=1)
      public class MyLilMDB implements MessageListener {

      static Logger logger = Logger.getLogger(MyLilMDB.class);

      @Resource
      private MessageDrivenContext mdc;

      public void onMessage(Message message) {

      try {
      TextMessage msg = (TextMessage)message;
      String xml = msg.getText();
      logger.info("Chopped Message:" + xml.substring(0, 100));
      }
      catch (Exception e) {
      logger.error(e.getMessage(),e);
      mdc.setRollbackOnly();
      }
      }