1 Reply Latest reply on Nov 3, 2005 8:09 AM by adrian.brock

    JBoss JMSReplyTo Not Sending to Specified Queue

    hacurtis

      I'm not certain this is particular issue with JBoss, but I seem to be having trouble responding to the Destination specified in the

      Message.getJMSReplyTo()


      I have a small test case where a message is sent on queue/D and there is another listener class receiving the onMessage(). Inside the onMessage I determine there is a not null Destination. I then modify the received message and send on the reply to queue. The reply to queue is set to queue/C by the original message sender code. Also, a simple system out of the replyQueue indicates it is set to queue/C (It displays as QUEUE.C in the replyQueue toString()). A small excerpt of the onMessage is shown here:

      Destination replyDestination = message.getJMSReplyTo();
       if (replyDestination instanceof Queue) {
       replyQueue = (Queue) replyDestination;
       .....
       TextMessage outboundMessage =
       replySession.createTextMessage(replyMsg);
       QueueSender senderx = replySession.createSender(replyQueue);
       senderx.send(outboundMessage);
       senderx.close();
       }


      The problem I'm experiencing is the message appears to be sent on the received queue instead of the queue specified by the destination. The onMessage receives all the messages it sends out (even though it is just listening on queue/D), and the queue/C does not have any pending messages.

      My question is, what am I doing wrong? Why doesn't the above code send the message on queue/C?