You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by nomit babraa <h....@sheffield.ac.uk> on 2020/02/29 15:50:04 UTC

Route Message from Active MQ Queue1 to Queue2 unchanged

Hi

When I consume a message from Queue1 and simply send it to Queue2, the
message that has landed on Queue 2 has:

1) the messageId on the original message now populated in the breadcrumbId
header.
2) a new messageId.

Can I just transfer the message unchanged keeping the messageId the same?

I've tried forceSendOriginalMessage=true (and also mapJmsMessage=false) as
below but this made no difference.

 from(
"cMQConnectionFactory1:queue:queue1?forceSendOriginalMessage=true")
.routeId("testMove_cJMS_1")
.to("cMQConnectionFactory1:queue:queue2")
.id("testMove_cJMS_2");

thanks for any advice

n

Re: Route Message from Active MQ Queue1 to Queue2 unchanged

Posted by nomit babraa <h....@sheffield.ac.uk>.
Okay - thanks all for the guidance.
It seems a shame this behaviour is fixed. I have 2 routes sending to the
same direct: endpoint. Messages from one route have the messageId I want in
the actual messageId field, messages from the other have the messageId I
want in the breadcrumbId. I'd hoped I didn't need to check for the
existence of a breadcrumbid but will have to..
cheers


On Sun, 1 Mar 2020 at 11:21, Jan Bednář <ma...@janbednar.eu> wrote:

> Hi,
> No you can't do this with any broker. It is against JMS specification.
>
> https://javaee.github.io/javaee-spec/javadocs/javax/jms/Message.html#setJMSMessageID-java.lang.String-
>
> Dne 1.3.2020 v 11:29 nomit babraa napsal(a):
> > Hi
> > Thanks for that.
> > Can I get the Broker (AMQ) to not assign a new MessageId?
> > Cheers
> > N
> >
> > On Sun, 1 Mar 2020 at 10:09, Claus Ibsen <cl...@gmail.com> wrote:
> >
> >> Hi
> >>
> >> You cannot keep JMSMessageID as its an ID that is 100% assigned by the
> >> message broker. Clients cannot control it.
> >>
> >> On Sat, Feb 29, 2020 at 4:50 PM nomit babraa <h....@sheffield.ac.uk>
> >> wrote:
> >>> Hi
> >>>
> >>> When I consume a message from Queue1 and simply send it to Queue2, the
> >>> message that has landed on Queue 2 has:
> >>>
> >>> 1) the messageId on the original message now populated in the
> >> breadcrumbId
> >>> header.
> >>> 2) a new messageId.
> >>>
> >>> Can I just transfer the message unchanged keeping the messageId the
> same?
> >>>
> >>> I've tried forceSendOriginalMessage=true (and also mapJmsMessage=false)
> >> as
> >>> below but this made no difference.
> >>>
> >>>   from(
> >>> "cMQConnectionFactory1:queue:queue1?forceSendOriginalMessage=true")
> >>> .routeId("testMove_cJMS_1")
> >>> .to("cMQConnectionFactory1:queue:queue2")
> >>> .id("testMove_cJMS_2");
> >>>
> >>> thanks for any advice
> >>>
> >>> n
> >>
> >>
> >> --
> >> Claus Ibsen
> >> -----------------
> >> http://davsclaus.com @davsclaus
> >> Camel in Action 2: https://www.manning.com/ibsen2
> >>
>
>

Re: Route Message from Active MQ Queue1 to Queue2 unchanged

Posted by Jan Bednář <ma...@janbednar.eu>.
Hi,
No you can't do this with any broker. It is against JMS specification.
https://javaee.github.io/javaee-spec/javadocs/javax/jms/Message.html#setJMSMessageID-java.lang.String-

Dne 1.3.2020 v 11:29 nomit babraa napsal(a):
> Hi
> Thanks for that.
> Can I get the Broker (AMQ) to not assign a new MessageId?
> Cheers
> N
>
> On Sun, 1 Mar 2020 at 10:09, Claus Ibsen <cl...@gmail.com> wrote:
>
>> Hi
>>
>> You cannot keep JMSMessageID as its an ID that is 100% assigned by the
>> message broker. Clients cannot control it.
>>
>> On Sat, Feb 29, 2020 at 4:50 PM nomit babraa <h....@sheffield.ac.uk>
>> wrote:
>>> Hi
>>>
>>> When I consume a message from Queue1 and simply send it to Queue2, the
>>> message that has landed on Queue 2 has:
>>>
>>> 1) the messageId on the original message now populated in the
>> breadcrumbId
>>> header.
>>> 2) a new messageId.
>>>
>>> Can I just transfer the message unchanged keeping the messageId the same?
>>>
>>> I've tried forceSendOriginalMessage=true (and also mapJmsMessage=false)
>> as
>>> below but this made no difference.
>>>
>>>   from(
>>> "cMQConnectionFactory1:queue:queue1?forceSendOriginalMessage=true")
>>> .routeId("testMove_cJMS_1")
>>> .to("cMQConnectionFactory1:queue:queue2")
>>> .id("testMove_cJMS_2");
>>>
>>> thanks for any advice
>>>
>>> n
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>>


Re: Route Message from Active MQ Queue1 to Queue2 unchanged

Posted by nomit babraa <h....@sheffield.ac.uk>.
Hi
Thanks for that.
Can I get the Broker (AMQ) to not assign a new MessageId?
Cheers
N

On Sun, 1 Mar 2020 at 10:09, Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> You cannot keep JMSMessageID as its an ID that is 100% assigned by the
> message broker. Clients cannot control it.
>
> On Sat, Feb 29, 2020 at 4:50 PM nomit babraa <h....@sheffield.ac.uk>
> wrote:
> >
> > Hi
> >
> > When I consume a message from Queue1 and simply send it to Queue2, the
> > message that has landed on Queue 2 has:
> >
> > 1) the messageId on the original message now populated in the
> breadcrumbId
> > header.
> > 2) a new messageId.
> >
> > Can I just transfer the message unchanged keeping the messageId the same?
> >
> > I've tried forceSendOriginalMessage=true (and also mapJmsMessage=false)
> as
> > below but this made no difference.
> >
> >  from(
> > "cMQConnectionFactory1:queue:queue1?forceSendOriginalMessage=true")
> > .routeId("testMove_cJMS_1")
> > .to("cMQConnectionFactory1:queue:queue2")
> > .id("testMove_cJMS_2");
> >
> > thanks for any advice
> >
> > n
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>

Re: Route Message from Active MQ Queue1 to Queue2 unchanged

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You cannot keep JMSMessageID as its an ID that is 100% assigned by the
message broker. Clients cannot control it.

On Sat, Feb 29, 2020 at 4:50 PM nomit babraa <h....@sheffield.ac.uk> wrote:
>
> Hi
>
> When I consume a message from Queue1 and simply send it to Queue2, the
> message that has landed on Queue 2 has:
>
> 1) the messageId on the original message now populated in the breadcrumbId
> header.
> 2) a new messageId.
>
> Can I just transfer the message unchanged keeping the messageId the same?
>
> I've tried forceSendOriginalMessage=true (and also mapJmsMessage=false) as
> below but this made no difference.
>
>  from(
> "cMQConnectionFactory1:queue:queue1?forceSendOriginalMessage=true")
> .routeId("testMove_cJMS_1")
> .to("cMQConnectionFactory1:queue:queue2")
> .id("testMove_cJMS_2");
>
> thanks for any advice
>
> n



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2