[Daily study]apache camel| Ibmwebsphere MQ Header issue| MQRFH2 | MQSTR

Source: Internet
Author: User
Tags apache camel

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&amp;showbody=false&amp;multiline=false&amp; 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.