How to get Response from another channel in mirth

Riyaz shaik picture Riyaz shaik · Jun 28, 2013 · Viewed 10.8k times · Source

We have two channels called channelA and channelB.

In channelA we have two destinations

  • a. first destination will invoke the channelB with XML data as input and get the response from the channelB in XML format.

  • b. retrieve the response of first destination in xml format and process it.

var dest1 = responseMap.get("destination1"); var resMessage = dest1.getMessage();

I am getting channelB response as "Message routed successfully".

How I will get actual XML from channelB instead of "Message routed successfully" message.

We are doing above steps to define generic channels such that we can reuse it in different scenarios in the mirth application.

We using mirth 2.2.1.5861 version.

Answer

Sid picture Sid · Jun 30, 2013

Create ChannelB having source data type as an XML, and put source as a channel reader. You have to make a single destination on ChannelA as a Channel Writer, and put ChannelB in the details.

This way whatever message you get in the form of an XML in ChannelAwill be routed to ChannelB.