web stats
Error routing message response - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-05-2014, 06:12 AM
seaston seaston is offline
OBX.3 Kenobi
 
Join Date: Feb 2010
Location: London, UK
Posts: 168
seaston is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 02-05-2014, 07:13 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,111
narupley is on a distinguished road
Default

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.
Reply With Quote
  #3  
Old 02-05-2014, 07:23 AM
seaston seaston is offline
OBX.3 Kenobi
 
Join Date: Feb 2010
Location: London, UK
Posts: 168
seaston is on a distinguished road
Default

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 webinars@mirthcorp.com to request further explanation.
Reply With Quote
  #4  
Old 02-05-2014, 07:29 AM
seaston seaston is offline
OBX.3 Kenobi
 
Join Date: Feb 2010
Location: London, UK
Posts: 168
seaston is on a distinguished road
Default

Like this?

Code:
responseMap.get('d1').getStatusMessage()
Reply With Quote
  #5  
Old 02-05-2014, 07:39 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,111
narupley is on a distinguished road
Default

Quote:
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.
Reply With Quote
  #6  
Old 12-12-2016, 03:47 AM
john.pipolo@svhm.org.au john.pipolo@svhm.org.au is offline
Mirth Newb
 
Join Date: Mar 2007
Location: Melbourne
Posts: 10
john.pipolo@svhm.org.au
Default 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)
Reply With Quote
  #7  
Old 12-12-2016, 04:02 AM
siddharth siddharth is offline
Mirth Guru
 
Join Date: Feb 2013
Posts: 832
siddharth is on a distinguished road
Default

Is that target channel active and deployed?
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 09:31 AM.


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