OSB and JMS Business Service Configuration
By MarkSmith on Nov 17, 2008
When using distributed message queuing in OSB, it is possible for a large number of messages to arrive on a single physical queue. This happens when the upstream client sends messages in bulk via a single connection. As distributed queue load balancing is done per connection, the use of a single connection this way will not load balance correctly.
This is demonstrated in the example below where an external JMS client connects to a distributed queue. The underlying WebLogic queuing infrastructure actually makes the connection to one of the physical queues. While this connection is kept open, the client sends many messages, which all end up on the single physical queue.
In this instance, it is important that OSB correctly load balances the messages from this point so downstream bottlenecks are avoided. JMS based Business Services must be configured correctly to enable load balancing to occur where multiple physical queues make up a single distributed queue. The following configuration will not load balance correctly:
Using a single endpoint with multiple host and port combination's results in the business service selecting the first available host/port combination it finds. So in the above case, one of the four physical instances of queue.Fabric.ProductStatus will end up getting all of the messages. The load balancing algorithm is ignored in the above case as this algorithm is only applicable for two or more endpoints. This is an acceptable configuration for failover, but not for load balancing.
To correctly configure a JMS Business Service, each host/port combination must have a separate endpoint URI configured. This will enable the in-built OSB load balancing functionality to work. Each endpoint will get a share based on the algorithm used. An example is displayed below:
The use of the Random-Weighted algorithm gives the added benefit of being able to give certain endpoints a higher load based on its weighting.
Here is an WLST script extract that configures OSB Business Service URI endpoints:
# Setting Load Balancing algorithm to Random Weighted
outboundProps = endPoints.getOutboundProperties()
# For each host/port combination, create a new URI
for hostPort in hostPortList:
uri = 'jms://' + hostPort + '/' + qcf + '/' + queue
print 'Adding new endpoint value of: ' + uri
newURI = endPoints.addNewURI()
print 'Updated endpoint config with new endpoints'
print 'Updated Business Service ' + resourceRef.getFullName() + ' with new endpoint config'