4 Replies Latest reply on Jul 18, 2004 2:34 PM by Stephane Nicoll

    JMS Receive method Issue

    arghre sergyr Newbie


      I do have some code related to JMS in my stateless session, basically in one method I am dumping some info into queue and in the other method I am retrieving the information from the same queue. The sender part goes fine without any problems, but it is NOT retrieving any information in the receive method. Below is the complete information:

      JBoss version: jboss-3.0.4

      QueueConntection factory userd: ConnectionFactory

      The queue info is provided in the jbossmq-destinations-service.xml

      With the bean, the resource ref are defined in the deployment descriptors as below in ejb-jar.xml

      Default QueueFactory

      And as below in jboss.xml


      the code is referring the connection factory as below:

      queueConnectionFactory = (QueueConnectionFactory) envContext.lookup("ConnectionFactory");

      which gets executed properly and the sending info is

      QueueSender queueSender = queueSession.createSender(userTaskSenderQueue);



      and receive part is

      QueueSession queueSession = queueConnectionFactory.createQueueConnection().createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

      QueueReceiver queueReceiver = queueSession.createReceiver(userTaskSenderQueue);

      Message receivedMsg = queueReceiver.receive();

      But it goes in the hanged stage when we call the receive method, I am not sure whether message is posted into the queue or not and whether the problem is to do with the receive method.

      Your help is highly appreciated!