Monday, March 16, 2015

WebLogic JMS Unit of Order

There may be a requirement to process stream of messages from particular group or publisher in-order from JMS Queue or Distributed Queue in cluster environment but at the time stream of messages from all other groups should be processed in parallel, means the whole queue should not be blocked when processing particular group or UOO stream.
Good example of above requirement is when we have thousands of user sessions and each session creates some sort of events and all those events needs to be processed in order and at the same time events from other sessions shouldn’t be blocked, they should be processed in parallel.

Unit-Of-Order feature of WebLogic JMS provides the solution for above requirement. You can set UOO (Unit-Of-Order) property to some key when publishing messages in to the queue. UOO key for a message is set in JMS header and kept by the name JMS_BEA_UnitOfOrder. It will enforce processing of stream of messages with same key (group) in order (First in First out) and other group of messages with different key will be processed in parallel.

This feature works well both in cluster (Distributed Destination) and non-clustered single node (Queue) environment.

Clustered Distributed Destination:

To use UOO feature in clustered environment it is required that you use separate JMS server targeted to each node in a cluster and each JMS server use its own persistence store. Single JMS server targeted to cluster would not work.

  1.  Create Separate JMS server for each node in a cluster with its own persistence store.
  2. Create one JMS module and target it to JMS servers you created in step 1 using sub-deployment.
  3. Create Uniform Distributed Queue inside the JMS module and target it to JMS servers using sub-deployment you have created in JMS module using advance targeting.
  4. Similarly create connection factory inside the JMS module and target it to JMS servers using sub-deployment you have created in JMS module using advance targeting.

Setting UOO property in OSB

Using JMS Transport:

If you are using JMS transport in OSB, you can set JMS_BEA_UnitOfOrder property in JMS header using Transport headers in request pipeline inside route node when publishing the message, simple as that.



Using JCA JMS adapter OSB 12c:


If you are using JCA JMS adapter out of OSB 12c then setting JMS_BEA_UnitOfOrder property in transport header doesn’t work instead you would need to set jca.jms.WeblogicUnitOfOrder



Setting this property in transport headers will overrides the value specified via property UnitOfOrder in JCA adapter configuration wizard.

No comments: