Announcement

Collapse
No announcement yet.

Error routing message response

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

  • Error routing message response

    Is anyone able to advise how I may trap this error in the Response Transformer and turn it into something meaningful?

    Code:
    ERROR: Error routing message to channel id: ea665d8d-c975-4b11-bf85-3f7362859517 [ChannelException: null]
    I am seeing this error on destination Channel Writer connectors when the receiving channel has been stopped.

    I've tried looking for the response message (which I expect to be blank) using this:

    Code:
    var ResponseMessage = response.getMessage();
    logger.info("ResponseMessage: "+ ResponseMessage.toString());
    but this code does not appear to be executed as noting appears in the log.

  • #2
    Well first, that code isn't executing because the response transformer only executes if the there's actually a response payload. In this case where the message failed to be sent in the first place, no payload yet exists. However there's an exception to this rule: If the inbound response data type is Raw, then the response transformer will run no matter what. So, you can set your response inbound/outbound data types to Raw, and then that code will always run.

    Regarding your actual code, what you probably want is the status message, not the message (sorry for the similarly named things). In the response transformer, you have access to the variable response, which is an ImmutableResponse object (you can right click and select View User API to get to the same place hosted locally by your instance of Mirth Connect). There are four methods available:

    public String getMessage()
    • Returns the actual response data, as a string.


    public Status getNewMessageStatus()
    • Returns the Status (e.g. SENT, QUEUED) of this response, which will be used to set the status of the corresponding connector message.


    public String getError()
    • Returns the error string associated with this response, if it exists.


    public String getStatusMessage()
    • Returns a brief message explaining the reason for the current status.


    The latter three values are also available directly in the response transformer scope, as responseStatus, responseStatusMessage, and responseErrorMessage, respectively. You can also see those variables used in the templates available in the Reference tab, under the category "Response Transformer".
    Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

    Nicholas Rupley
    Work: 949-237-6069
    Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


    - How do I foo?
    - You just bar.

    Comment


    • #3
      I'm guessing that I could also access these items from the postprocessor if I wanted to provided that I specify the destination that I am interested in?

      Please could you indicate how I would access the responseStatusMessage for destination 1in the postprocessor as an example?

      I have been getting rather confused about how to access various messages and properties and have sent a request to [email protected] to request further explanation.

      Comment


      • #4
        Like this?

        Code:
        responseMap.get('d1').getStatusMessage()

        Comment


        • #5
          Originally posted by seaston View Post
          Like this?

          Code:
          responseMap.get('d1').getStatusMessage()
          Yes that's correct, assuming 1 is the metadata ID of the destination you're trying to grab it from (you can view that in the destination table).
          Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

          Nicholas Rupley
          Work: 949-237-6069
          Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


          - How do I foo?
          - You just bar.

          Comment


          • #6
            ERROR MESSAGE: Error routing message to channel id:

            Hi

            Getting queued message due to error response below. Any thoughts or is this too generic an error. Channel connectivity test successful.

            Mirth version 3.2.2.7694

            Channel Writer error
            ERROR MESSAGE: Error routing message to channel id: 8ddaac1a-d6cc-4ca1-b6ba-8e74928f81a4
            com.mirth.connect.donkey.server.channel.ChannelExc eption
            at com.mirth.connect.server.controllers.DonkeyEngineC ontroller.dispatchRawMessage(DonkeyEngineControlle r.java:495)
            at com.mirth.connect.connectors.vm.VmDispatcher.send( VmDispatcher.java:157)
            at com.mirth.connect.donkey.server.channel.Destinatio nConnector.handleSend(DestinationConnector.java:73 8)
            at com.mirth.connect.donkey.server.channel.Destinatio nConnector.run(DestinationConnector.java:627)
            at java.lang.Thread.run(Thread.java:745)

            Comment


            • #7
              Is that target channel active and deployed?
              HL7v2.7 Certified Control Specialist!

              Comment

              Working...
              X