1 Reply Latest reply on May 24, 2010 3:22 AM by jaikiran pai

    Can not receive JMS message in JBoss AS 6.0.0.M3

    David K Newbie



      I have a MDB (EJB3) which is listening to the queue "queue/testMsg"  configured in HornetQ. And deploy the ear in JBoss AS 6 M3.


      I can send my queue(check the MessageCount in jmx-console is 1), but I can not handle it by MessageListener.onMessage() and the JBoss has not any error log. I can receive it by MessageConsumer.


      Please help me and find out the reason.


      1. hornetq-jms.xml

      <configuration xmlns="urn:hornetq"
                  xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">

         <connection-factory name="ConnectionFactory">
               <connector-ref connector-name="netty"/>
               <entry name="ConnectionFactory"/>
               <entry name="XAConnectionFactory"/>

         <queue name="testMsg">
            <entry name="queue/testMsg"/>



      2. send queue

         queueSession = queueConnection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
         QueueSender queueSender = queueSession.createSender(queue);


         ObjectMessage message = queueSession.createObjectMessage(testMsg);//testMsg is my ObjectMessage


      3. MessageListener

      @MessageDriven(activationConfig = {
              @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
              @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/testMsg")}
      public class MessageEJB3 implements MessageListener {

          public void onMessage(Message message) {
              System.out.println("Handle the message........");