[jboss-user] [Messaging, JMS & JBossMQ] - Strange Problem!!!

vijayaraghava do-not-reply at jboss.com
Thu Oct 19 05:15:06 EDT 2006


Hi,

     Iam sending messages to a queue(MyQueue) using JMS and MDB is consuming them. But the problem is that the MDB is not getting invoked for all messages and this doesn't happen all the time. Sometimes it works perfectly fine and sometimes it doesn't consume any messages or just consumes only some of the messages. I think the configuration is fine.

     Iam using JBoss 4.0.4, EJB 3.0, JavaEE 5.0


   Relevant snippets of configuration files and code are as follows:


   1) jbossmq-destinations-service.xml  --- added a new queue
 
          
         <depends optional-attribute-name="DestinationManager">
                  jboss.mq:service=DestinationManager
         
         
        

   2)  Code using JMS API

           context = new InitialContext();
           connectionFactory =  
                    (ConnectionFactory)context.lookup("ConnectionFactory");
	   destinationName = "queue/MyQueue";
	   Queue testExecutionQueue = 
                    (Queue)context.lookup(destinationName);
	   connection = connectionFactory.createConnection();
	   session = connection.createSession(false, 
                               Session.AUTO_ACKNOWLEDGE);
           msgProducer = session.createProducer(testExecutionQueue); 
           connection.start();
           ObjectMessage message = session.createObjectMessage();
           message.setObject(msg);
           msgProducer.send(message);
     
           // Close the connection

     3)  MDB 

             // Only the annotations  --- others are not required I guess

       @MessageDriven(activationConfig =  {
       @ActivationConfigProperty(propertyName="destinationType",
       propertyValue="javax.jms.Queue"),
       @ActivationConfigProperty(propertyName="destination",
       propertyValue="queue/MyQueue")    })


     Thats it. In the JBoss configuration file, I only changed the file mentioned in 1). 

       The problem is strange because it happens sometimes and works perfectly at other times.

       Where am I going wrong? 

      Thank you.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3979290#3979290

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3979290



More information about the jboss-user mailing list