Products | Versions |
---|---|
TIBCO BusinessConnect | - |
Not Applicable | - |
Resolution:
Description:
============
When using JMS with BusinessConnect, you must use Smart Routing if multiple private processes are listening to messages from BusinessConnect JMS queues. This is because of the architecture of JMS.
Environment
============
TIBCO BusinessConnect all versions
Cause:
=========
When using RVCM, multiple private process subscribers can receive and confirm the same RESPONDER.REQUEST message, whether or not they will actually use it. When using JMS, BusinessConnect sends RESPONDER.REQUEST messages out on a single JMS queue. With a JMS queue, a message is delivered only once to only one queue subscriber. Once it is delivered, it is removed from the queue and no other subscribers can receive it. With multiple processes listening to a single queue, all processes are expected to handle any message on the queue.
Without Smart Routing, queues can deadlock as shown by the following example. Consider Process A that is listening for message type EDIFACT-A and Process B that is listening for message type EDIFACT-B. Let’s say BC publishes both messages on the same JMS queue with message EDIFACT-B sent first and message EDIFACT-A being sent second. With the JMS architecture, either Process A or Process B can pick up messages off the queue. If Process A picks up Message EDIFACT-B, it will deadlock because it does not know what to do with the message (since it is not set up to process it). No other process can pick up the message (nor any subsequent message) off the queue until Process A releases it (which it will never do), so all other processes will deadlock as well.
If you have one BW engine handling multiple types of operations, you will not see the issue as the one engine will know how to handle all incoming messages from the queue. The above situation will occur when a BW engine does not process all the operation types that come from BC.
Resolution:
=========
With Smart Routing, BC "decorates" the JMS message with an additional Smart Route Id, which can be used as a JMS message selector. This Smart Route ID is outside the payload. The BW-BC palette uses the Smart Route ID as a JMS queue message selector. When using the Smart Route ID the palette will only subscribe to JMS messages with the specified message selector and it will ignore all other messages on the queue.
In the example above, we set each message to have a Smart Route ID that is the name of the message (“EDIFACT-A” and “EDIFACT-B”). We can then set Process A to listen to messages with Smart Route “EDIFACT-A”, and Process B to listen to messages with Smart Route “EDIFACT-B”. Process A will ignore messages from EDIFACT-B because its specified Smart Route ID will not match the Smart Route ID on the message. Process B will pick up the message and process it because its Smart Route ID will match the Smart Route ID on the JMS message. Similarly, EDIFACT-A messages will only be picked up by Process A.
Also, when using JMS, there should be only one BC connection per BC queue for all starter processes in a particular BW project. Multiple BC connections listening to the same BC queue will cause the BW project to "hang" even when using Smart IDs for all process starters.