Sidebar

How do ACK (Message Acknowledgment) scripts work in QIE

0 votes
1.0K views
asked Dec 11, 2013 by gary-t-8719 (14,860 points)

2 Answers

0 votes

If the channel is configured to wait for an ACK messages QIE will send 1 Message and wait for the ACK and after receiving the ACK back proceed to send the next message. When a channel is configured to wait for ACK messages all messages are sent serially.

If the channel is not configured to wait for the ACKs then we will send the messages out and ignore all ACKs that may be sent back. Keep in mind that this method will NOT guarantee deliver of the messages so you have no way of knowing if the reciving system received the message or not.

There are three things to keep in mind when processing an ACK message of any type (XML, HL7, CSV, et cetera).

1. QIE stores the ACK message in a variable named "response"

2. The ACK or value stored in the response variable is a string value.

3. After evaluating the response the ACK script should return a Boolean value (true or false, or a 1 or 0). If a non-boolean value is passed then it will always be evaluated as a successful response.

See also How to process an XML ACK

See Also How to process an XML ACK with embeded HL7

answered Nov 5, 2014 by gary-t-8719 (14,860 points)
0 votes

As further clarification on item #3 above, the following options are available when creating an ACK Script.  

 

ACK Script Results

Result Description
returns 'true' The message will be marked as completed and the response will be stored as the response received.
 
NOTE: Returning anything other than ‘false’ or ‘0’ will be evaluated as a successful response.

returns 'false'

or message.error(msg)

The message will be sent to the error queue with an error message of “ACK error:” plus the response received or “msg” if message.error(msg) is used and the response will be stored as the response received.
 
NOTE: Can also return ‘0’ as ‘false’.

JavaScript throw

or qie.throwAckError(msg)

Aborts the ACK Script with an error and causes an error log message to be recorded with the text of the error that was thrown.
 
After “Ack Timeout” the message is sent again, up to “Max Resend” times, after which it is sent to the error queue with an error message of “message not acknowledged after being sent XXX times” or “msg” if qie.throwAckError(msg) is used.  The last response is stored as the response received and any previous responses received are ignored.
 
NOTE: The “Ack Timeout” and “Max Resend” options on the Destination Node control how many times the message will be resent before being sent to the error queue.

qie.simulateSendError(msg)

or qie.throwSendError(msg)

Aborts the ACK Script with an error and causes the message to be resent as if the message was not sent in the first place.  After the “Error msg after XXX consecutive send errors” has been reached, the message is sent to the error queue with the “msg” and stacktrace as the error message.  If “Stop after XXX consecutive send errors” is reached, then the channel is also stopped.
 
NOTE: The “Error msg after XXX consecutive send errors” and “Stop after XXX consecutive send errors” options under “Error Management” on both the Destination Node and Channel are used to configure this behavior.

 

answered Jun 10, 2015 by ron-s-6919 (4,480 points)
...