Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   Queue on Failure (http://www.mirthcorp.com/community/forums/showthread.php?t=216490)

hnouh 09-14-2016 02:32 PM

Queue on Failure
Mirth Version:

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.


narupley 09-15-2016 07:51 AM

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?

hnouh 09-15-2016 09:05 AM

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
77: outWriter.close();
79: //At this point you've called the service
80: //Now you have to get the response in a stream
82: var inputStream = conn.getInputStream();
84: var streamRead = new java.io.InputStreamReader(inputStream);
86: var resp = new java.io.BufferedReader(streamRead);
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

narupley 09-15-2016 09:16 AM

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:


try {
    // Do something
} catch (e) {
    return new Response(QUEUED, '', e.javaException.getMessage(), org.apache.commons.lang3.exception.ExceptionUtils.getStackTrace(e.javaException));

hnouh 09-15-2016 02:15 PM

Queue on Failure (my channel attached)
1 Attachment(s)

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.


hnouh 09-20-2016 03:29 PM

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

thanks a lot.

All times are GMT -8. The time now is 07:54 AM.

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