Announcement

Collapse
No announcement yet.

Message Queue - on failure

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

  • 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
    Best Regards,
    Alex Neiva

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

    Comment


    • #3
      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?
      Best Regards,
      Alex Neiva

      Comment


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

        Comment

        Working...
        X