com.atomikos.jms
Class Bridge
java.lang.Object
com.atomikos.jms.AbstractBridge
com.atomikos.jms.Bridge
- All Implemented Interfaces:
- javax.jms.MessageListener
public class Bridge
- extends AbstractBridge
A default bridge implementation that forwards JMS messages from the source to
the destination. Instances can be used to bridge different JMS providers. The
destination is set explicitly as a Queue(Topic)SenderSessionFactory, whereas the
source is set implicitly by setting a bridge instance as the MessageListener
to a Queue(Topic)ReceiverSession or Queue(Topic)ReceiverSessionPool.
Note that the replyTo header is NOT passed over the brige. Instead, we
recommend configuring a dedicated replyTo queue (topic) at a well-known
location, and configuring a second bridge that connects the replyTo
channels in both interconnected JMS provider domains.
For request/reply across JMS vendor domains X and Y, we therefore recommend
the following configuration:
For the request channel:
- A request queue (topic) in domain X
- A Queue(Topic)ReceiverSessionPool that listens on this request queue (topic)
- A Bridge that uses this session pool as its source, and that has as its
destination:
- A Queue(Topic)SenderSessionFactory that sends messages to the corresponding
request queue (topic) in domain Y
For the reply channel:
- A reply queue (topic) in domain Y, also set as the replyToQueue(Topic) property of
the request channel bridge
- A Queue(Topic)ReceiverSessionPool that listens on this reply queue (topic)
- A Bridge that uses this session pool as its source, and that has as its
destination:
- A Queue(Topic)SenderSessionFactory that sends messages to the corresponding
reply queue (topic) in domain X
In order to close all resources, it is recommended that the receiver session
configuration is set to notify the listener (the bridge, in this case) when
the session is closed. See the notifyListenerOnClose property of the
Queue(Topic)ReceiverSession(Pool).
Method Summary |
protected javax.jms.Message |
bridgeMessage(javax.jms.Message message)
Transform a message into another message. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Bridge
public Bridge()
bridgeMessage
protected javax.jms.Message bridgeMessage(javax.jms.Message message)
throws javax.jms.JMSException
- Description copied from class:
AbstractBridge
- Transform a message into another message. Subclasses should override this
method to change the argument message format into the returned message
format.
- Specified by:
bridgeMessage
in class AbstractBridge
- Parameters:
message
- The message as it comes from the source session (and queue).
- Returns:
- Message The corresponding message to be put on the destination
queue.
- Throws:
javax.jms.JMSException
Copyright © 2011. All Rights Reserved.