web stats
Queue on Failure - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 09-14-2016, 01:32 PM
hnouh hnouh is offline
OBX.1 Kenobi
 
Join Date: Aug 2015
Posts: 31
hnouh is on a distinguished road
Smile 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,
Reply With Quote
  #2  
Old 09-15-2016, 06:51 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,119
narupley is on a distinguished road
Default

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.
Reply With Quote
  #3  
Old 09-15-2016, 08:05 AM
hnouh hnouh is offline
OBX.1 Kenobi
 
Join Date: Aug 2015
Posts: 31
hnouh is on a distinguished road
Default 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
------------------------------------------------------------------------------------
Reply With Quote
  #4  
Old 09-15-2016, 08:16 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,119
narupley is on a distinguished road
Default

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.
Reply With Quote
  #5  
Old 09-15-2016, 01:15 PM
hnouh hnouh is offline
OBX.1 Kenobi
 
Join Date: Aug 2015
Posts: 31
hnouh is on a distinguished road
Default 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
File Type: xml my-channel.xml (15.1 KB, 6 views)
Reply With Quote
  #6  
Old 09-20-2016, 02:29 PM
hnouh hnouh is offline
OBX.1 Kenobi
 
Join Date: Aug 2015
Posts: 31
hnouh is on a distinguished road
Default

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

thanks a lot.
Reply With Quote
Reply

Tags
messages, mirth connect, on failure, queue

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 05:01 PM.


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