Route Message from Active MQ Queue1 to Queue2 unchanged

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Route Message from Active MQ Queue1 to Queue2 unchanged

nomit babraa
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
Reply | Threaded
Open this post in threaded view
|

Re: Route Message from Active MQ Queue1 to Queue2 unchanged

Claus Ibsen-2
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 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: Route Message from Active MQ Queue1 to Queue2 unchanged

nomit babraa
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 <[hidden email]> 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 <[hidden email]>
> 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
>
Reply | Threaded
Open this post in threaded view
|

Re: Route Message from Active MQ Queue1 to Queue2 unchanged

Jan Bednář
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 <[hidden email]> 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 <[hidden email]>
>> 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
>>

Reply | Threaded
Open this post in threaded view
|

Re: Route Message from Active MQ Queue1 to Queue2 unchanged

nomit babraa
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ář <[hidden email]> 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 <[hidden email]> 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 <[hidden email]>
> >> 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
> >>
>
>