Setting IBM MQ custom property using Camel and JMS doesn't work

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

Setting IBM MQ custom property using Camel and JMS doesn't work

Anuja B
Hi

I am using Apache Camel, JMS without JNDI to send messages to IBM MQ.

Tried:
exchange.getIn().setHeader( "customProperty", "123" );
This didn't work and found out that I have to set camel jms header and not camel header.

Tried setting the following next:
jmsComponent.setAllowAdditionalHeaders("customProperty=12345");
This didn't work either.

I am trying to read the property using:
jmsMessage.getObjectProperty("customProperty")

Have written a sample java code (without camel) to test this and it works well, so as of now it seems like a camel problem.
I have been stuck with this for days. Please help.

The below link says some mode has to be set, but I can't figure it out which mode?
http://camel.465427.n5.nabble.com/Add-custom-stringproperty-to-jms-message-td5751745.html

Thanks




DISCLAIMER: "The information in this e-mail and any attachment is intended only for the person to whom it is addressed and may contain confidential and/or privileged material. If you have received this e-mail in error, kindly contact the sender and destroy all copies of the original communication. IBS makes no warranty, express or implied, nor guarantees the accuracy, adequacy or completeness of the information contained in this email or any attachment and is not liable for any errors, defects, omissions, viruses or for resultant loss or damage, if any, direct or indirect."
Reply | Threaded
Open this post in threaded view
|

Re: Setting IBM MQ custom property using Camel and JMS doesn't work

jbonofre
HI,

By default, camel-jms populate the JMS property using message headers (assuming you don’t use a header filter strategy).

Did you try to set the header ?

If the header is MQMHD specific, you have to use camel-wmq (from camel-extra) instead of camel-jms.

Regards
JB

> Le 13 janv. 2021 à 15:33, Anuja B <[hidden email]> a écrit :
>
> Hi
>
> I am using Apache Camel, JMS without JNDI to send messages to IBM MQ.
>
> Tried:
> exchange.getIn().setHeader( "customProperty", "123" );
> This didn't work and found out that I have to set camel jms header and not camel header.
>
> Tried setting the following next:
> jmsComponent.setAllowAdditionalHeaders("customProperty=12345");
> This didn't work either.
>
> I am trying to read the property using:
> jmsMessage.getObjectProperty("customProperty")
>
> Have written a sample java code (without camel) to test this and it works well, so as of now it seems like a camel problem.
> I have been stuck with this for days. Please help.
>
> The below link says some mode has to be set, but I can't figure it out which mode?
> http://camel.465427.n5.nabble.com/Add-custom-stringproperty-to-jms-message-td5751745.html
>
> Thanks
>
>
>
>
> DISCLAIMER: "The information in this e-mail and any attachment is intended only for the person to whom it is addressed and may contain confidential and/or privileged material. If you have received this e-mail in error, kindly contact the sender and destroy all copies of the original communication. IBS makes no warranty, express or implied, nor guarantees the accuracy, adequacy or completeness of the information contained in this email or any attachment and is not liable for any errors, defects, omissions, viruses or for resultant loss or damage, if any, direct or indirect."