No announcement yet.

Requeueing an HTTPSender on router.

  • Filter
  • Time
  • Show
Clear All
new posts

  • Requeueing an HTTPSender on router.

    Question - it is possible to re-queue an HTTPSender if a router.routeMessage funciton in the response transformer fails.


    Our workflow: We have a WebAPI web site that we have all of our message mapping code in. Our workflow is to receive inbound messages with our integration engine, pass the message off to our API server for mapping / transformation, receive the transformed message back from our WebAPI server, then send the message on to the destination via the integration engine.

    I am trying to re-create this in Mirth as a proof of concept (we are unhappy with our current integration vendor and are looking to change).

    My channel is attached. I am able to pass the message off to our API, receive the message back, get the message from the response in the response transformer, and route the message to a channel reader / tcp sender combination. When everything is functioning, it works awesome.

    In trying to introduce errors, i disabled the channel that the router.routeMessage method is trying to send the message from the API to. When the channel is turned off, i receive the error message below. I did a bunch of searching in the forums but couldn't find anything that was related to my particular issue. I did try to wrap the method in a try/catch, but the code never hits the catch. I'm assuming the error handling in router.routeMessage handles the error gracefully, and wont allow the catch to be hit.

    let me know what you think.



    Error recieved:
    [2017-03-21 15:25:55,154] ERROR (com.mirth.connect.server.userutil.VMRouter:114): Error routing message to channel id: 4739ca21-7401-4130-8929-14798c01f73f eption
    at ector.dispatchRawMessage(
    at com.mirth.connect.server.controllers.DonkeyEngineC ontroller.dispatchRawMessage(DonkeyEngineControlle
    at com.mirth.connect.server.userutil.VMRouter.routeMe ssageByChannelId(
    at com.mirth.connect.server.userutil.VMRouter.routeMe ssage(
    at com.mirth.connect.server.userutil.VMRouter.routeMe ssage(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n 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.Interpreter.interpretLoop(I
    at org.mozilla.javascript.Interpreter.interpret(Inter
    at org.mozilla.javascript.ContextFactory.doTopCall(Co
    at org.mozilla.javascript.ScriptRuntime.doTopCall(Scr
    at org.mozilla.javascript.InterpretedFunction.exec(In
    at com.mirth.connect.server.util.javascript.JavaScrip tTask.executeScript(
    at com.mirth.connect.server.transformers.JavaScriptRe sponseTransformer$ResponseTransformerTask.doCall(J
    at com.mirth.connect.server.transformers.JavaScriptRe sponseTransformer$ResponseTransformerTask.doCall(J
    at com.mirth.connect.server.util.javascript.JavaScrip
    at Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$ (Unknown Source)
    at Source)
    Attached Files
    Last edited by arronramsey; 03-22-2017, 05:26 AM.

  • #2
    Yep, that's easy to do. Try this:

    var routerResponse = router.routeMessage(interfaceRoutingName, returnedMessage);
    if (routerResponse.getStatus() == ERROR) {
    	responseStatus = QUEUED;
    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.


    • #3
      Thanks. I will give that a try this afternoon. Also - it seems like when i search a post, you are everywhere! lol. Thank you for being so involved with the forums.


      • #4
        following up. worked great. Also as an FYI routerResponse is null when there is no error so on successful routes, routerResponse.getStatus() was throwing an error in the log. Below did the trick. Thanks again

        var routerResponse = router.routeMessage(interfaceRoutingName, returnedMessage);
        if(routerResponse != null)
        var routerResponseMessage = routerResponse.getStatus();
        if(routerResponseMessage == ERROR)
        responseStatus = QUEUED;