com.atomikos.jms
Class Bridge

java.lang.Object
  extended by com.atomikos.jms.AbstractBridge
      extended by 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:

For the reply channel:

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).


Constructor Summary
Bridge()
           
 
Method Summary
protected  javax.jms.Message bridgeMessage(javax.jms.Message message)
          Transform a message into another message.
 
Methods inherited from class com.atomikos.jms.AbstractBridge
copyHeadersAndProperties, createBytesMessage, createMapMessage, createObjectMessage, createStreamMessage, createTextMessage, onMessage, setDestinationSessionFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bridge

public Bridge()
Method Detail

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.