Announcement

Collapse
No announcement yet.

Queue on Failure

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

  • Queue on Failure

    Mirth Version: 3.4.0.8000

    I'm sending multiple messages to an SRP which throws back errors sometimes when the service is busy. I wanted my channels to queue anything which errors and try it again 20 seconds later (for example). I tried the Queue Messages on Failure on the destinations tab with the following settings: Regenerate/rotate/including transformer/10 retries/ Interval 20000 ms, in addition in the source tab I turned on the Source Queue ,the Queue Buffer Size is set to 1000, the Response is None, the Process Batch is no, and Maximum Max processing threads is 1.


    would you please assist me with this because it's really driving me crazy. I will really appreciate any feedback or help.

    Thank you in advance.

    Sincerely,

  • #2
    You haven't explained what the problem is. Is it not queuing? Do the messages error out? What type of destination connector are you using? Are you getting a payload/response at all, or is the destination unable to connect to begin with?
    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
      Queue on Failure

      When a message that I'm sending to the server errors out. the statistics shows that there is an error (with red). The error is actually from the server and it is java FileNOtFound error (please see bellow). The problem is that how come even with the current settings that I have, the failed or error messages do not queue? My goal is for them to queue and to send them again after 20 seconds. Maybe the server wont be busy and the message will go throw successfully.
      ---------------------------------------------------------------------------
      Transformer error
      ERROR MESSAGE: Error evaluating transformer
      com.mirth.connect.server.MirthJavascriptTransforme rException:
      CHANNEL: RAPI proj-add agent Trans
      CONNECTOR: sourceConnector
      SCRIPT SOURCE: TRANSFORMER
      SOURCE CODE:
      77: outWriter.close();
      78:
      79: //At this point you've called the service
      80: //Now you have to get the response in a stream
      81:
      82: var inputStream = conn.getInputStream();
      83:
      84: var streamRead = new java.io.InputStreamReader(inputStream);
      85:
      86: var resp = new java.io.BufferedReader(streamRead);
      LINE NUMBER: 82
      DETAILS: Wrapped java.io.FileNotFoundException: https://register.staging.drfirst.com/ws/wsAddUser
      at f739e74b-961c-4517-acfa-95cb438b0cf2:82 (doTransform)
      at f739e74b-961c-4517-acfa-95cb438b0cf2:127 (doScript)
      at f739e74b-961c-4517-acfa-95cb438b0cf2:129
      at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.doCall(JavaS criptFilterTransformer.java:154)
      at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.doCall(JavaS criptFilterTransformer.java:119)
      at com.mirth.connect.server.util.javascript.JavaScrip tTask.call(JavaScriptTask.java:113)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
      at java.lang.Thread.run(Unknown Source)
      Caused by: java.io.FileNotFoundException: https://register.staging.drfirst.com/ws/wsAddUser
      at sun.net.http://www.protocol.http.HttpURLConn...Stream(Unknown Source)
      at sun.net.http://www.protocol.https.HttpsURLCo...Stream(Unknown Source)
      at sun.reflect.GeneratedMethodAccessor149.invoke(Unkn own Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.mozilla.javascript.MemberBox.invoke(MemberBox. java:126)
      at org.mozilla.javascript.NativeJavaMethod.call(Nativ eJavaMethod.java:225)
      at org.mozilla.javascript.Interpreter.interpretLoop(I nterpreter.java:1479)
      at org.mozilla.javascript.Interpreter.interpret(Inter preter.java:815)
      at org.mozilla.javascript.InterpretedFunction.call(In terpretedFunction.java:109)
      at org.mozilla.javascript.ContextFactory.doTopCall(Co ntextFactory.java:393)
      at org.mozilla.javascript.ScriptRuntime.doTopCall(Scr iptRuntime.java:3280)
      at org.mozilla.javascript.InterpretedFunction.exec(In terpretedFunction.java:120)
      at com.mirth.connect.server.util.javascript.JavaScrip tTask.executeScript(JavaScriptTask.java:142)
      at com.mirth.connect.server.transformers.JavaScriptFi lterTransformer$FilterTransformerTask.doCall(JavaS criptFilterTransformer.java:143)
      ... 6 more
      ------------------------------------------------------------------------------------

      Comment


      • #4
        First of all you haven't answered all the questions I asked. What type of destination connector are you using?

        Looks like you're doing that in the transformer. If a message errors out in the filter/transformer script, it will be a hard ERROR and will not queue.

        If you want it to queue, you can move that script into a JavaScript Writer destination. You can return Response or Status objects from the script itself. So for example you can do this:

        Code:
        try {
            // Do something
        } catch (e) {
            return new Response(QUEUED, '', e.javaException.getMessage(), org.apache.commons.lang3.exception.ExceptionUtils.getStackTrace(e.javaException));
        }
        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


        • #5
          Queue on Failure (my channel attached)

          Hello,

          I apologize. I think I misunderstand some of your questions. I tried to put the try and catch within the transformer in the source tab, but that didn't cause the failed messages to queue. i have attached my channel. would you please take a look and tell me what I'm doing wrong. (Note, the try and catch is not added to this version. it's my original channel).

          thank you so much in advance.


          Sincerely,
          Attached Files

          Comment


          • #6
            Sorry I posted a new reply. I added the channel. Any help will be really appreciated.

            thanks a lot.

            Comment

            Working...
            X