web stats
Auto Generated responses - what do they respond? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 11-10-2014, 02:00 AM
gkittlaus gkittlaus is offline
OBX.3 Kenobi
 
Join Date: Jan 2012
Posts: 104
gkittlaus is on a distinguished road
Default 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 at 02:03 AM.
Reply With Quote
  #2  
Old 11-10-2014, 06:26 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,115
narupley is on a distinguished road
Default

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.
Reply With Quote
  #3  
Old 11-10-2014, 07:34 AM
gkittlaus gkittlaus is offline
OBX.3 Kenobi
 
Join Date: Jan 2012
Posts: 104
gkittlaus is on a distinguished road
Default

Quote:
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?
Reply With Quote
  #4  
Old 11-10-2014, 08:00 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,115
narupley is on a distinguished road
Default

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.
Reply With Quote
Reply

Tags
dynamic, response, soap, webservice

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 10:59 AM.


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