Configuring the Eclipse Amlen resource adapter to preserve message order
Message order is important to some asynchronous messaging applications where messages must be processed in the same order in which the producer sends them. Your design must take message order into account if message order is important to your application.
One example where message order is important might be a messaging application that processes seat reservations. The messaging application might have producer components and a consumer component. A producer component sends a message to the consumer component when a customer reserves a seat. If the customer cancels the reservation, then the producer sends a second message. Typically, the consumer component must process the first message (which reserves the seat) before it processes the second message (which cancels the reservation).
Some applications use a synchronous request-response pattern where the producer waits for a response to each message before sending the next message. In this type of application, the consumer controls the order in which it receives the messages. The consumer can ensure that the order in which messages are received matches the order in which the producer or producers are sending the messages. Other applications use an asynchronous fire and forget pattern where the producer sends messages without waiting for responses. Even for this type of application, order is usually preserved. A consumer receives messages in the same order as the producer or producers send them, especially when there is a significant time between sending consecutive messages. However, your design must consider factors that can disrupt this order.
The order of messages is disrupted if your application explicitly receives a message other than the first by specifying message selectors. Parallel processing by using concurrent consumers and error or exception processing can also affect message order.
Consider the following property settings when you configure the Eclipse Amlen resource adapter to ensure that messages are processed in the same order in which they are received.