1
votes

I use Camel with Fuse, and I have trouble with setting JMSReplyTo. Here is an excerpt from my route:

<setHeader headerName="JMSReplyTo" id="_setHeader2">
    <constant>QTEST</constant>
</setHeader>
<setHeader headerName="CamelJmsDestinationName" id="_setHeader1">
    <constant>queue://QM_TEST/SYSTEM.DEFAULT.LOCAL.QUEUE?targetClient=1</constant>
</setHeader>
<to id="_to1" uri="websphere:queue:SYSTEM.DEFAULT.LOCAL.QUEUE?replyTo=QTEST"/>

I took as an example the code given here: Implementing native websphere MQ with CoD over Camel JMS component At first, I thought it is because I removed unwanted jms header with targetClient=1 directive set in CamelJmsDestinationName header, but even without it, it won't set anything to ReplyToQ attribute of MQMD. I tried the suggestion given here too How to send message to different Queue hosted in different queue manager and hostname in IBM MQ cluster, but this also doesn't work for me, that is like this:

queue://QM_TEST/QTEST?mdReadEnabled=true&messageBody=0&mdWriteEnabled=true&XMSC_WMQ_REPLYTO_STYLE=1&targetClient=1

The question is why does it not work?

1
Could you be more specific about what is not working? Is the MQMD and MQRFH2 header correctly generated?Souciance Eqdam Rashti
MQMD is generated with blank ReplyToQ, and I want it to have the string specified with JMSReplyTo in it (that is QTEST in this example). MQRFH2 header is generated depending on targetClient set to 1 or not, but it also doesn't have that setting in it. And I would like it set only in MQMD, and avoid usage of MQRFH2, that's one very important use case for me.hdjur_jcv
I would think it would be best to look here first where the mappings are outlined: ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/…Souciance Eqdam Rashti
Why do you not want to include MQRFH2?Souciance Eqdam Rashti
When the receiving MDB is setup so that it doesn't expect that header, I must know how not to include it. I have already studied these mappings, before posting here. So, by looking at them, how do you propose I should set ReplyToQ in MQMD?hdjur_jcv

1 Answers

2
votes

I have figured out how to set ReplyToQ attribute, but this is only a part of the problem that I'm facing now. As explained here, in JMS Producer chapter:

http://camel.apache.org/jms.html

all that is needed is this:

        <setHeader headerName="CamelJmsDestinationName" id="_setHeader1">
            <constant>queue://QMib_TEST/OUTPUTQ?targetClient=1</constant>
        </setHeader>
        <to id="_to1" uri="websphere:queue:SYSTEM.DEFAULT.LOCAL.QUEUE?replyTo=REPLYQ" pattern="InOut"/>

What this does is it puts request message to OUTPUTQ, and then listens on REPLYQ, but with matching some autogenerated Correlation ID. Good thing is that ReplyToQ is now set to REPLYQ in a request message, due to pattern="InOut" setting, bad thing is that the in our case replying application responds with setting Correlation ID to Message ID of received request, all from MQMD, and this Camel pattern by default doesn't generate message id in MQMD of request equal to (JMS?) correlation ID that it expects, so that response remains in queue, not consumed, even though it was put in proper queue. In fact, it even repeats putting requests after a wait interval for get elapses, producing further reponse messages unconsumed in REPLYQ. So, that is another problem I have to solve, how to deal with MessageID and CorrelationID properly, but the one from the subject, I have solved.