====update version: api changed======
An ordering group is a set of messages that needs to be delivered sequentially exactly in
the same order as they are produced.
I Enable Ordering Group by programming
JBossMessageProducer::enableOrderingGroup(String name); //user specified name, null for
sys generated
JBossMessageProducer::disableOrderingGroup();
The two methods enable/disable the JBossMessageProducer to produce messages that belong to
a named ordering group. Messages in a named ordering group will be processed strictly in
the order they are produced (sent). The enableOrderingGroup(name) will set producer's
ordering group to the specified name, or an auto-generated name if passing a null
parameter. Calling disableOrderingGroup() will reset the producer to be a normal JMS
producer.
Once thus set, the producer will set a reserved message property JBM_ORDERING_GROUP_ID to
the name of the ordering group on each message sent through it.
JBossMessages that have this property set are treated as ordering group messages and those
that have one same value form an ordering group.
Other Processing Rules of Ordering Group Messages
1. The order of delivery will not be affected by sort criteria, priority, or filters.
2. Only if one message has been processed (acked, committed, rolled back, expired) can
next message be delivered.
3. Uncommitted or unacked Messages in one ordering group must be within the same
JMSSession or same transaction.
4. The processing of ordering group messages applies to both Queues and Topics.
II Enable Ordering Group by Administration
1. A ConnectionFactory can be configured to have ordering group enabled by default, i.e.
all producers created from this factory have ordering group enabled. The user can override
the default ordering group settings on the producer later by calling setOrderingGroup()
methods.
2. A Destination can be configured to have ordering group enabled by default, i.e., any
messages sent to this destination will automatically set to belong to the configured
default ordering group if they haven't already belonged to one.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180481#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...