Saturday, 17 October 2015

Sample Scenario For combining the Temporary message in the Queue with the new message that is obtained in the middle of the flow using the MQGet node

MQGET:-
we know MQGet node can be used anywhere in a message flow to store message in intermediate state & afterwords in another thread of flow we can aggregate this temporary result to form final output (Getting message by correl/message id..)

Following example illustrates how an intermediate message can be combined to incoming message to form final message.

First Flow : IN (MQInput) ,Compute, TEMP (MQOutput)
Here the Compute node copies the message id of the incoming message to correlation id of output message, so that we can retrieve this intermediate message based on correlation id.
SET OutputRoot.MQMD.CorrelId  =  InputRoot.MQMD.MsgId;

Second Flow :  IN2 (MQInput),MQGet (MQGet), OUT (MQOutput)

Set the properties of MQGet Node as


INPUT MESSAGE FOR FIRST FLOW IN IS :- <WORKED_FOR><PROJECT>IRCTC_MB_NEW</PROJECT></WORKED_FOR>

INPUT MESSAGE FOR SECOND FLOW IN2 IS:-
<COMPANY>
<NAME>NEW MB WAVES</NAME>
<PROJECTDETAILS>----------</PROJECTDETAILS>
</COMPANY>

Motto:-
Now i am trying to combine both the messages from IN,IN2 and make a single output message so for this purpose i will make the MQGet Node properties be set as


Give the queue name for Temp Node in First flow and MQGet node in second flow as similar
(for example let it be as :-OUT)

The final result obtained at the end of the flow is

<COMPANY>
<NAME>NEW MB WAVES</NAME>
<PROJECTDETAILS>IRCTC_MB_NEW</PROJECTDETAILS>
</COMPANY>

No comments:

Post a Comment