Thursday, July 9, 2009

Bridges between Destinations

You can create bridges between destinations so that messages sent to one destination are also delivered to all bridged destinations. Bridges are created between one destination and one or more other destinations of the same or of different types. That is, you can create a bridge from a topic to a queue or from a queue to a topic.



Why Bridge destinations?
Some applications require the same message to be sent to more than one destination, possibly of different types. For example, an application may send messages to a queue for distributed load balancing. That same application, however, may also need the messages to be published to several monitoring applications. Another example is an application that publishes messages to several topics. All messages however, must also be sent to a database for backup and for data mining. A queue is used to collect all messages and send them to the database.



Bridges are not transitive and they are uni-directional. That is, if there is a bridge between A to B, then message sent to A can only flow to B and not the other way. Similarly, if there is a bridge between destination A to B and another bridge between destination B and C. Then any message sent to A will flow to B but not to C.

  • Selecting Messages: By default, all messages sent to a destination with a bridge are sent to all bridged destinations. This can cause unnecessary network traffic if each bridged destination is only interested in a subset of the messages sent to the original destination. You can optionally specify a message selector for each bridge to determine which messages are sent over that bridge.
  • Access Control: Message producers must have access to a destination in order to send messages to that destination. Messages can only be sent to bridged destinations to which the message producer has access.
  • Transactions: When a message producer sends a message within a transaction, all messages sent across a bridge are part of the transaction. Therefore, if the transaction succeeds, all messages are delivered to all bridged destinations. If the transaction fails, no consumers for bridged destinations receive the messages.

0 comments:

Popular Posts

  © Blogger templates The Professional Template by Ourblogtemplates.com 2008

Back to TOP