activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Bain <>
Subject Re: msg.getJMSReplyTo().toString() and Session.createQueue(replyString)
Date Mon, 02 Oct 2017 18:46:55 GMT
Session.createQueue() is defined as part of the JMS spec, and it's not a
bug when it doesn't do things beyond the requirements of the spec.

Just strip off the prefix yourself before you call it.


On Oct 2, 2017 5:15 AM, "boekhold" <> wrote:


The following code fails:

String replyDestStr = msg.getJMSReplyTo().toString();
// forward the request asynchronously to a 3rd-party system, with
// "replyDestStr" included in the 3rd-party request and response
Queue replyQ = session.createQueue(replyDestStr);

The problem is that the first line returns something like
"queue://queuename", but the createQueue() call doesn't strip that off, and
I end up posting to a queue that is *actually* called "queue://queuename".

Which is a bit weird, because ActiveMQDestination.createDestination(name)
*does* strip off the qualified prefixes.

Unfortunately I cannot use the ActiveMQDestination.createDestination() call
because my code has to be generic (specifically it has to work with
WebsphereMQ as well).

Is this a bug perhaps? Maybe ActiveMQSession.createQueue() shouldn't call
"new ActiveMQQueue()", but "ActiveMQDestination.createDestination(name, 1)"?


Sent from:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message