In recent work, a strange problem has been encountered:
Phenomenon: In camel development, when sending an XML message to Assasin through IBM Websphere MQ, there will be more <mcd> and so on such a header.
by check:
Being that Camel was using the JMS API to write a message to an MQ queue, MQ would use the RHQ2 header to store information about the message, etc. However, the Reading app is a NON-JMS app, which cannot read the RFH2 header. We would like to strip the header by utilizing the TARGETCLIENT=MQ in our put call, but this isn ' t working. We tried targetclient=1 as well
The reason is that MQ automatically adds these header information, and the client side is not recognized, so cannot read, an exception occurs.
Solution:
When returning to the client, queue plus targetclient=1, tell MQ driver, do not send header information.
<route id= "QName" >
<from uri= "Amq:queue:qname"/>
<transacted ref= "Requiredjta"/>
<to uri= "log:com.wellsfargo.1txc?showheaders=true&showbody=false&multiline=false& Level=info "/>
<setheader headername= "Cameljmsdestinationname" ><constant>queue:///qname?targetclient=1</ Constant></setheader>
<to uri= "Wmq:queue:qname"/>
</route>
Another scenario:
Use this class to configure in the Jmsconfiguartion class:
Https://jira.spring.io/secure/attachment/12688/IBMWebSphereMqDestinationResolver.java
Where code: private int targetclient = Jmsc. Mqjms_client_jms_compliant;
To change to: private int targetclient = Jmsc. MQJMS_CLIENT_NONJMS_MQ;
[Daily study]apache camel| Ibmwebsphere MQ Header issue| MQRFH2 | MQSTR