web stats
Message Queue - on failure - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-22-2016, 08:12 AM
AlexNeiva AlexNeiva is offline
Mirth Guru
 
Join Date: Oct 2013
Location: Portugal
Posts: 275
AlexNeiva is on a distinguished road
Exclamation Message Queue - on failure

Mirth Version: 3.3.1.7856

I've a channel that i send a message to it's destination, and when it fails i want to that message be queued. Queued messages on Mirth are resend untill message it's sents correctly. My question is how can i do so on first attempt on failure messages goes to a queue but retry sent just for 3 times and them put them on error.
How can i do it? can sent somes channels example?

Thanks
Reply With Quote
  #2  
Old 02-22-2016, 08:22 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,101
narupley is on a distinguished road
Default

As long as you have the queue enabled (On Failure or Always), the message will be queued if it fails to send. Depending on the connector though, some messages may get forced to ERROR. For example if you're using a TCP Sender for HL7 messaging and you receive an AR NACK, then by default the message will error out. You can modify the response validation properties, or you can use a response transformer to force the message to queue whenever you want.
__________________
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-23-2016, 02:08 AM
AlexNeiva AlexNeiva is offline
Mirth Guru
 
Join Date: Oct 2013
Location: Portugal
Posts: 275
AlexNeiva is on a distinguished road
Default

But for example, if i'm trying to send an XML file to a path that is correctly unavailable or not exist, if i put my message on a queue what can i do to when it trys to resend 3 times then "stop" to send and put on error instead infinite resend?
Reply With Quote
  #4  
Old 02-23-2016, 06:46 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,101
narupley is on a distinguished road
Default

Quote:
Originally Posted by AlexNeiva View Post
But for example, if i'm trying to send an XML file to a path that is correctly unavailable or not exist, if i put my message on a queue what can i do to when it trys to resend 3 times then "stop" to send and put on error instead infinite resend?
If that's what you want to do, then turn queuing off, and instead set a retry count of 3.

Or if you still want everything to happen asynchronously, switch the queue to Always, and in the response transformer you can force the message to ERROR if the send attempts are above a certain threshold:

Code:
if (responseStatus == QUEUED && connectorMessage.getSendAttempts() >= 4) {
	responseStatus = ERROR;
}
In that latter case you will want to set the response data types to Raw to ensure that the response transformer will run even when there's no response.
__________________
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
Reply

Tags
destination, failure, queue, queued, retry

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 03:22 AM.


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