camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From igoldsmith <>
Subject Re: JMS ReplyTo not sent for InOnly Pattern
Date Sun, 07 Nov 2010 00:53:53 GMT

I'm not sure what you mean by creating a sample project.  I'm not really a
developer.  I'm a product manager.

I think that the specification of replyTo on an endpoint should always
ensure that there is a replyTo specified in messages sent by the
JMSProducer, because if the route creator specifies it, then that is what
they intend.  The only decision should be what to do in the event that there
is already a replyTo header in the message.  

I would argue that the default behavior should be to always use the value
specified in the endpoint (i.e. override any value provided in the
exchange).  If the administrator wants to reverse this default they could
use the preserveMessageQos=true option, although replyTo doesn't really seem
to fit into the category of QoS.  

I think adding the following code to the JMS Producer right before the
initiation of the messageCreator might do the job:

        // if the endpoint contains a replyTo header then we'll always use
        // unless the preserveMessageQos flag is set, in which case we'll
only use it
        // if the exchange doesn't contain a replyTo
        if (endpoint.getReplyTo() != null) {
        	if (!endpoint.isPreserveMessageQos() ||
(exchange.getIn().getHeader("JMSReplyTo") == null)) {
        		exchange.getIn().setHeader("JMSReplyTo", endpoint.getReplyTo());

Not the most graceful solution, but I think it works.


Claus Ibsen-2 wrote:
> There may be an issue on the producer side to send a message as InOnly
> to a JMS destination and preserving the JMSReplyTo header.
> Fell free to create a little sample project with a couple of routes
> which highlights your intention.
> Then we can use that for unit tests and implementing this in camel-jms
> if an option is missing.

View this message in context:
Sent from the Camel - Users (activemq) mailing list archive at

View raw message