We have seen, as part of a client project, the requirement to manage acknowledgments (ACK) and negative acknowledgments (NACK) when sending messages. This means we need to respond differently in the event of:
In this article, we will look at the acknowledgment system (ACK) offered by BizTalk. We will start by implementing acknowledgments using orchestration and end with a simple demonstration.
Before going further, it is important to stress that a custom pipeline component could equally well be used to promote the AckRequired property (a Boolean indicating whether an acknowledgment of receipt is needed) and thus dispense with orchestration. However, after various tests, we have seen that promoting the property using a pipeline component works very well for negative acknowledgments (NACK) but does not work as desired when the message has been sent correctly (ACK).
We consequently decided to opt for orchestration, because in our situation, we need to be able to handle both ACK and NACK types.
Microsoft.XLANGs.BaseTypes.DeliveryFailureException;
Demonstration below with a very simple example of traffic, using FILE type transports. You are then free to adapt this principle of ACK/NACK management elsewhere as it stays the same regardless of the transport type used (SMTP, FTP, SQL, etc.).
Our port list is shown below:
The filters for the SendPort.ACK and SendPort.NACK ports are respectively:
The aim is to produce different responses depending on successful sending of the message or otherwise.
Binding of other ports with orchestration:
Lastly, we will trigger the message traffic with 3 files including 1 flat file and 2 XML files:
The result for the promoted properties AckSendPortName and AckType (generated by the DeliveryNotification=Transmitted property in the orchestration):
Note: the AckType property is set to ACK if the message reaches its destination, and to NACK if it does not.
The files for acknowledgment message routing are shown below:
In our example, these files are empty but they do nonetheless equate to an acknowledgment of receipt. It would be entirely possible to use other transport types (SMTP, etc.) and to use a custom pipeline component to set up the desired responses.
The files backed up at the end of the process, for which the contents have definitely been delivered:
As can be seen, setting up the acknowledgment system (ACK and NACK) offered by BizTalk is inexpensive and straightforward, which means we can adopt different responses depending on the successful sending of messages or otherwise.