activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Tully <>
Subject Re: How to forward a full message received in Java by onMessage() into another queue?
Date Fri, 20 Aug 2010 10:07:18 GMT
you need to think of each jms message as a fire and forget entity,
immutable once sent. The properties whose name begin with "JMS" are
for use by the JMS implementation so they will be set by the sender
JMS implementation code to what ever is needed by the implementation.

An application is in control of the payload and any non standard
properties, it is an applications responsibility to replicate these
attributes from message to message (camel does this sort of thing for
you automatically with some sensible defaults). The application cannot
expect invariance of the standard JMS* or JMSX* properties.

On 20 August 2010 09:47, BenXS <> wrote:
> Hmm, this is interesting.
> If I set in a new JMS message the destination Queue to "aaa"  with the
> method setJMSDestination() but sent the JMS Msg to another queue "bbb" then
> the JMS header field JMSdestination will will be brutally overwritten with
> "bbb".
> I can imagine that this happens with the JMSmessageID in the same way. If
> (for another new) JMSmsg
> the user sets the JMSmesaggeId to 4711 it will automatically be overwritten
> by a new generated Number from ActiveMQ.  Has someone tried this out?
> Ben
> It will be a new message with a new Id, so you will need to explicitly
> set the correlationID to the original messageID
> On 13 August 2010 14:28, Martin C. <> wrote:
>> Hi,
>> On Fri, Aug 13, 2010 at 2:30 PM, Gary Tully <> wrote:
>>> you need a message producer and do producer.send(..., message);
>> will this also preserve the message ID or will a new message ID be
>> used for this message? I am interested as I may need to forward some
>> messages to another broker and I'd like to keep the message ID for use
>> in the answer's correlation ID.
>> Thanks in advance!
>> Best regards,
>> Martin
> --
> View this message in context:
> Sent from the ActiveMQ - User mailing list archive at


Open Source Integration

View raw message