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

      Hi

       

      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"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">

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

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

      </configuration>

       

      2. send queue

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

       

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

       

      3. MessageListener

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

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

          }
      }

       

      Thanks!!!