The ordered queue facility of iSM collects messages for dispatch and ensures that they are dispatched in the appropriate order. It is a variation of the Internal Queue listener and emit service, and supports the complete set of capabilities of the internal queuing facility.
In the internal queuing facility, messages are emitted to the queue, where they are selected for execution generally in the order of arrival. Multiple subchannels can be defined to process the messages in parallel. Pended messages are placed back on the queue as they are selected to be retried. The use of multiple subchannels (threads) and the use of pending prevent any control of message ordering. To maintain ordering, applications frequently define a single subchannel and avoid use of the pending facility. This technique maintains ordering, but at the expense of performance and complexity. This is the issue that the ordered internal queue facility is intended to address.
The ordered queue facility allows messages to be categorized by group. A group is any value of meaning to the application. For example, a patient ID, a transaction ID, a shipment number, and so on. The group identifier is passed along with the message from the emit service. Messages within the group will be dispatched by the Ordered Queue listener in the order they are received. The group is defined when it is first presented for a message. There is no need to predefine the group during configuration.
Within a group, subsorting by a designated sequencing field is possible, allowing the ordered queue to resort the messages before passing them to the application process flow. This allows situations, such as the unpredictability of input order due to communication delays for some messages or unsorted input in general to be handled. The intra-batch subsort key is presented by the emit service. For non-batching queues, subsorting is not available.