Does TIBCO EMS guarantee message ordering?i.e. the messages published will arrive in the same order at the consumer side?

Does TIBCO EMS guarantee message ordering?i.e. the messages published will arrive in the same order at the consumer side?

book

Article ID: KB0090018

calendar_today

Updated On:

Products Versions
TIBCO Enterprise Message Service -
Not Applicable -

Description

Resolution:
Order is guaranteed at a publisher level given the same delivery mode and priority.

messages are only guaranteed to be ordered per topic per publisher.  Thus, if there are two publishers on the same topic, no guarantee is made as to the ordering of messages between the two publishers.

JMS 1.1 specs, section 4.4.10. provides detailed discussion of the message order in JMS. TIBCO EMS conform to all JMS specifications.

========
4.4.10.1 Order of Message Receipt

Messages consumed by a session define a serial order. This order is important because it defines the effect of message acknowledgment. See Section 4.4.11 "Message Acknowledgment," for more details. The messages for each of a session's consumers are interleaved in a session's input message stream. JMS defines that messages sent by a session to a destination must be received in the order in which they were sent (see Section 4.4.10.2 "Order of Message Sends," for a few qualifications). This defines a partial ordering constraint on a session's input message stream.

JMS does not define order of message receipt across destinations or across a destination's messages sent from multiple sessions. This aspect of a session's input message stream order is timing-dependent. It is not under application control.

4.4.10.2 Order of Message Sends

Although clients loosely view the messages they produce within a session as forming a serial stream of sent messages, the total ordering of this stream is not significant. The only ordering that is visible to receiving clients is the order of messages a session sends to a particular destination. Several things can affect this order:

o Messages of higher priority may jump ahead of previous lower-priority messages.

o A client may not receive a NON_PERSISTENT message due to a JMS provider failure.

o If both PERSISTENT and NON_PERSISTENT messages are sent to a destination, order is only guaranteed within delivery mode. That is, a later NON_PERSISTENT message may arrive ahead of an earlier PERSISTENT message; however, it will never arrive ahead of an earlier NON_PERSISTENT message with the same priority.

o A client may use a transacted session to group its sent messages into atomic units (the producer component of a JMS transaction). A transaction's order of messages to a particular destination is significant. The order of sent messages across destinations is not significant. See Section 4.4.7 "Transactions," for more information.
========

Also if the consumer is multithreaded it may *process* messages out of the order they were received by the session object.

Issue/Introduction

Does TIBCO EMS guarantee message ordering?i.e. the messages published will arrive in the same order at the consumer side?