2 Replies Latest reply on Jun 7, 2012 2:40 PM by lusmall

    EJB3-MDB (listening to ActiveMQ queue) problem

    seeaganesh

      Hi,

      I have simple EJB3-MDB, listening to the ActiveMQ queue, deployed on JBOSS6.1.0 final app server. The ActiveMQ activemq-rar-5.4.3.rar is in place and all acivemq configuration is done properly. The activemq queue is tested. The ejb is also deployed without any error.

       

      My EJb code:

       

       

      @MessageDriven(activationConfig =

      {

      @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),

      @ActivationConfigProperty(propertyName="destination", propertyValue="queue.outbound"),

      @ActivationConfigProperty(propertyName="acknowledgeMode", propertyValue="Auto-acknowledge")

      })

      @org.jboss.ejb3.annotation.ResourceAdapter("activemq-rar-5.4.3.rar")

      public class TestEjb implements MessageListener{ 

       

      public TestEjb()

      {

      System.out.println("Inside contr:TestEjb");    

      }

          @Override

          public void onMessage(Message arg0) {

       

              System.out.println("Message got :" +arg0);

             

          }

       

      }

       

       

      ------>

      When using standalone program i send the message to queue.outbound, the message is not listened by this MDB. When I go to the jboss console and browse to the jar file of this ejb and from control tab "Restart" this MDB, the MDB listens to the messages.

       

      All messages are persisted into the DB, so i can see the messages in the queue.

      The question is why this MDB starts listening after i restart it from console???? Is there any problem with MDB+jboss6.1.0