web stats
Multiple Destinations response source settings - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 09-06-2019, 09:38 AM
rjmmccg rjmmccg is offline
Mirth Newb
 
Join Date: Dec 2014
Posts: 11
rjmmccg is on a distinguished road
Default Multiple Destinations response source settings

Mirth 3.8.0

I am trying to build TCP sender with 3 destinations. Channel works fine with single destination but when multiple destinations are added it does not respond from the host that the message is sent unless it is specifically identified in the source settings. I have attached the channel as well as a pic of source settings. Any assistance will be greatly appreciated.
Attached Images
File Type: png Capture.PNG (20.4 KB, 6 views)
Attached Files
File Type: xml TestMultiDest_Response.xml (64.0 KB, 2 views)
Reply With Quote
  #2  
Old 09-06-2019, 11:26 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 896
agermano is on a distinguished road
Default

What exactly are you trying to achieve?
Reply With Quote
  #3  
Old 09-06-2019, 07:24 PM
rjmmccg rjmmccg is offline
Mirth Newb
 
Join Date: Dec 2014
Posts: 11
rjmmccg is on a distinguished road
Default

I have an application that is querying a patient monitoring system via a tcp listener source and the tcp sender destination. There are multiple hosts in the patient monitoring system and therefore requires multiple destinations. I am filtering the query messages in the destinations so that messages are routed to the appropriate host. The host response contains the ack but also includes the data queried by the application. In the source settings I can select one of the destinations as the response and it will return message to the query app appropriately while the other two destinations receive the correct response but do not send it back through the source to the query app. The other two do receive an ack but no query data is included. I can set the source settings response to any one of the destinations and that one will work but the remain two others do not. Thank you for the reply!!
Reply With Quote
  #4  
Old 09-08-2019, 09:57 AM
rjmmccg rjmmccg is offline
Mirth Newb
 
Join Date: Dec 2014
Posts: 11
rjmmccg is on a distinguished road
Default

Just to clarify... The query message from the querying app filters through the destination and reaches correct the patient monitoring system host. The host responds with the correct query data and it returns to the destination. It just does not route back through the source to the querying app for 2 of the three destinations. The 1 destination identified in the source response setting does reach the querying app as expected. Thanks
Reply With Quote
  #5  
Old 09-09-2019, 07:50 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 896
agermano is on a distinguished road
Default

You can do this either with a responseMap variable or using the Post-processor.

Using a responseMap variable, in the Response Transformer for each destination you can store the response in a responseMap variable. This variable will then be selectable from your response drop-down. If you use the same key for all of your destinations, your source response will pick the response that was written by the destination that actually ran.

The Post-processor can see the responses from all of your destinations, and you can pick and return the one you want. You would select post-processor as your response in this case.

In either case, I'd recommend using a destinationSet filter in your source transformer rather then a filter on each destination. There's more info on this thread or in the user guide: https://www.mirthcorp.com/community/...d.php?t=217740
Reply With Quote
  #6  
Old 09-09-2019, 11:11 AM
rjmmccg rjmmccg is offline
Mirth Newb
 
Join Date: Dec 2014
Posts: 11
rjmmccg is on a distinguished road
Default

Thank you for the info!!! I have been working on it today but not successful yet. I have been able to get response variable in dropdown on source settings as you said but I'm not sure I have the ResponseMap variable correct since its not passing through to source. I have attached the response transformer that I'm using. Thank you again!!
Attached Files
File Type: xml ResponseMap_QryPrd_2019SEP09-2.xml (10.8 KB, 2 views)
Reply With Quote
  #7  
Old 09-09-2019, 12:55 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 896
agermano is on a distinguished road
Default

You should be able to do this with a single Mapper step.

If you don't need to actually process the response, set your response transformer inbound/outbound types to Raw. Then the msg variable will contain the entire response message as a string, and you can use msg as your mapping.

If you do need to do additional processing, but no modifications to the message, you can use response.getMessage() as your mapping.

In the response transformer, there is a variable named response that is an instance of ImmutableResponse from the User API.

If you need to modify the response, you'll need to serialize it yourself to put it into the responseMap. At this point, I'd probably let it serialize itself and switch to the post-processor to pick your final response instead of using the responseMap.
Reply With Quote
  #8  
Old 09-10-2019, 03:54 AM
rjmmccg rjmmccg is offline
Mirth Newb
 
Join Date: Dec 2014
Posts: 11
rjmmccg is on a distinguished road
Default

That's got it!! I really appreciate your help on this. I am going to look at building the DestinationSet filter in the source. Thank you again, You have been a tremendous help.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:55 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation