Announcement

Collapse
No announcement yet.

Auto Generated responses - what do they respond?

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

  • Auto Generated responses - what do they respond?

    Hello everyone,

    I'm trying to solve a (for me) tricky one challenge.

    I have a webservice listener which is listening for SOAP envelopes.
    These SOAPs can trigger 3 different types of messages.

    Right now I do the following:
    my source is configured to respond after processing
    I created a variable "response" like
    Code:
    responseMap.put('response', ...);
    This variable contains, depending on the trigger, a response for the webservice sender. It works so far.

    My problem is, that one of the triggers is doing a SMB/FTP upload. This upload can fail if the server is not available. So I am running in a timeout. This is usually 20 seconds.
    Now my channel waits for additional 20 seconds to send the response if I have smb/ftp problems.

    Is there a way to solve this? I want an immediate response but still dynamically on the SOAP Trigger.

    Thank you in advance

    EDIT: Well my title doesn't fit the question anymore, sorry for the confusion. Maybe the autogenerated responses can help me? But I cannot tell what they do at all and what they contain.
    Last edited by gkittlaus; 11-10-2014, 02:03 AM.

  • #2
    The two things you're asking don't make sense together at all. If you need to wait until all your destinations have finished before sending a response, then you can't respond immediately. And if you want to respond immediately, then you can't be waiting on your destinations to finish.

    If you want to respond immediately and don't care about using a dynamic response based on the completion status of the destinations, then that's where you would want to turn on the source queue, and use one of the auto-generate response options. Currently auto-generation is only implemented for HL7 v2.x, so if that's what your inbound data type is, then it should work.
    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
      Originally posted by narupley View Post
      The two things you're asking don't make sense together at all. If you need to wait until all your destinations have finished before sending a response, then you can't respond immediately. And if you want to respond immediately, then you can't be waiting on your destinations to finish.

      If you want to respond immediately and don't care about using a dynamic response based on the completion status of the destinations, then that's where you would want to turn on the source queue, and use one of the auto-generate response options. Currently auto-generation is only implemented for HL7 v2.x, so if that's what your inbound data type is, then it should work.
      yeah I know that sounds confusing, but is exactly what I need.

      to explain it a little bit more:
      we have three inbound trigger: send document, send document2 and query for data

      when receiving the inbound trigger for sending a document, it can imediatly reponse back with success.
      when receiving the query trigger, we want to build a response containing the data for that query. I know this is not possible, this is just logical.

      Anyhow, I wannt to try something different. I don't care about the query resquest so I simply want to send a response back imediatly, regarding the trigger, meaning:
      receive query > respond with "var queryResponse"
      receive doc1> respond with "var doc1Response"
      receive doc2> respond with "var doc2Response"

      The logic works: I build something in my preprocessor like:
      Code:
      var tempo = new XML(SerializerFactory.getSerializer('XML').toXML(message))
      var SOAPACTION = tempo['Header']['SOAPAction'].toString()
      
      if ( SOAPACTION == 'QueryRequest' ) {
      	ResponseFactory.getSentResponse('<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">...query...</s:Envelope>')
      } else if ( SOAPACTION == 'Document1' ) {
      	ResponseFactory.getSentResponse('<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">...doc1...</s:Envelope>')
      } else if ( SOAPACTION == 'Document2' ) {
      	ResponseFactory.getSentResponse('<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">...doc2...</s:Envelope>')
      }	else {
      	ResponseFactory.getSentResponse('')
      }
      anyway, what do I have to setup that mirth will respond with what I setup in my preprocessor?
      is this possible?

      Comment


      • #4
        Right now, you can only respond using a custom response if the source queue is off, which in turn means that it will not respond immediately, but rather after the entire message finishes.

        If you're okay with not waiting on certain destinations, you can turn on queuing for them. Then the main message processing thread will not be waiting on those destinations to finish. Then you can use the postprocessor (not the preprocessor) to return a dynamic 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