Announcement

Collapse
No announcement yet.

Multiple Destinations response source settings

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 Files

  • #2
    What exactly are you trying to achieve?

    Comment


    • #3
      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!!

      Comment


      • #4
        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

        Comment


        • #5
          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

          Comment


          • #6
            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

            Comment


            • #7
              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.

              Comment


              • #8
                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.

                Comment

                Working...
                X