When it is required to send a messages in sequence, Application typically follow any of the below mentioned approach.
1.Standard methodology(Sequence protocol):
User can make use of MSH.13 (sequence number) to send the messages in sequence.
For every message, a sending system sends the sequence number and incriments the number by one for successive messages.
For every message received, the receiving application has to store the sequence number of the most recently received message and it has to send an acknowledgment by echoing the sequence number in MSA.4 - expected sequence number.
Using a 0 (zero) indicates that the link is started or restarted.
When the receiving system receives a sequence number in the MSH 13, it should respond with an ack with MSA.4 containing the sequence number one greater than the last message received.
If the receiving system is not having the sequence number, it sends -1 in the MSA.4. Which indicate that the receiving system will use the sequence number of the first transaction it accepts as its initial sequence number.
" -1" is used for re-synchronize the link. When sending system sends -1, Receiving system
should send the acknowledgment with "- 1" in the expected sequence number in the field. With this, the receiving system then resets its sequence number to sequence number of the next transaction it accepts.
2: One-to-One acknowledgment.
simple one-to-one acknowledgment scheme can be used to send the message in sequence. In this method duplicate transactions cannot be prevented.
Cloud Computing and B2B
5 weeks ago
