Welcome!

Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic

Weblogic: Article

The BEA WebLogic Message Bridge

Trsnsfer Messages Between JMS Providers

What is a messaging bridge? And why and where would you use it?

A messaging system is one in which applications are loosely coupled through the exchange of messages. In crude terms it is like an e-mail system for applications.

A messaging bridge in turns moves messages between any two messaging systems/products. A messaging bridge consists of two destinations that are being bridged: a source destination from which messages are received, and a target destination to which messages are sent. Source and target bridge destinations can be either queues or topics.

BEA WebLogic introduced its messaging bridge in WebLogic 6.1, and has enhanced the features with later releases of WebLogic.

The WebLogic Messaging Bridge allows you to configure a forwarding mechanism between any two messaging products, thereby providing interoperability between separate implementations of BEA WebLogic JMS or between WebLogic JMS and another messaging product.

The WebLogic Messaging Bridge also provides the ability to specify a quality of service (QOS), as well as message filters, transaction semantics, and connection retry policies. Once a messaging bridge is configured, it is easily managed from the administration console, including temporarily suspending bridge traffic when necessary, tuning the execute thread pool size setting to suit your implementation, and monitoring the status of all your configured bridges.

Sample Application

This is a hypothetical application. It consists of two component applications, Stock Broker and Stock Exchange, that are deployed on Stock Broker Server and Stock Exchange Server respectively. Each component application should run independently of the other component, as well as communicating asynchronously with the other component. There is also a requirement that when one of the component applications sends a message the other component application should receive it as as soon as its server is in a running state.

Stock Broker Server is an online server that handles user requests. It will be able to take a stock purchase request and display whether the purchase request succeded or not, including the complete transaction history, if required. This server will not try to process the stock purchase request, but instead will send it to Stock Exchange Server for fulfillment.

Stock Exchange Server is an offline server that will receive messages from Stock Broker Server. It will receive the stock purchase requests and try to process them. This server might communicate with other external systems in order to fulfill the purchase request. For each stock purchase request received, this server will create a stock purchase response and will send the response back to Stock Broker Server.

In this implementation, Stock Broker is running on BEA WebLogic 8.1 and Stock Exchange is running on BEA WebLogic 7.0. WebLogic's JMS has been used for messaging on both servers, and WebLogic's Messaging Bridge has been used as a bridge between the two messaging systems. The choice of WebLogic 8.1 and WebLogic 7.0 along with WebLogic JMS messaging systems was here a matter of convenience. Conceptually, the messaging bridge can be used between any two messaging products.

As shown in Figure 1, Stock Broker Server has two queues, RequestSubmitQueue and ResponseReceiveQueue. Similarly, Stock Exchange Server has two queues, RequestReceiveQueue and ResponseSubmitQueue.

Stock Broker Server receives a stock purchase request from the user. SenderBean places the PurchaseRequestMessage on RequestSubmitQueue. Messaging Bridge1 forwards the message placed on RequestSubmitQueue of Stock Broker Server to RequestReceiveQueue of Stock Exchange Server.

Once a message is received on RequestReceiveQueue of Stock Exchange Server, ReceiveRequestMDB's (message driven bean) onMessage will be invoked by the container/server. ReceiveRequestMDB will get the object message and invoke ProcessRequestBean for fulfillment logic. ProcessRequestBean creates a PurchaseResponseMessage and invokes the SenderBean. The SenderBean is responsible for placing the PurchaseResponseMessage on the ResponseSubmitQueue. As soon as the message is placed on ResponseSubmitQueue, Messaging Bridge2 forwards that message to ResponseReceiveQueue of Stock Broker Server.

Once a message is received on ResponseReceiveQueue of the Stock Broker Server, ReceiveResponseMDBs onMessage will be invoked by the container/server. ReceiveResponseMDB will get the object message and invoke ProcessPurchaseResponseBean, which is responsible for processing the response and storing the response message to a flat file. The user can check the status of the current purchase request or the complete transaction history by accessing StockPurchaseResponse.jsp, which will invoke GetResponseFromStorage to get the list of response messages (transaction history) to be displayed.

In this sample application, any one or both of the messaging bridges can be turned off. At that time all the messages will be queued and will be forwarded to the target bridge destination as soon as the bridge is turned on again.

Similarly, if the server that is acting as a target destination of a messaging bridge is down (not in a running state), all of the messages will be queued and sent to the destination server's corresponding queue as soon as the target server becomes available (running state) again.

Example Scenario Demonstrating the Use of the Messaging Bridge
Let's assume that Stock Broker Server is in a running state, and Stock Exchange Server is brought down for regular maintenance or for some unforeseen reason.

  • A user enters a stock purchase request on Stock Broker Server. The Stock Broker Server takes the user's request, places the request on RequestSubmitQueue. Messaging Bridge1, which is responsible for forwarding the message, detects that Stock Exchange Server is not in a running state and does not do anything.
  • Stock Exchange Server is brought up to a running state. Messaging Bridge1 forwards the queued request to Stock Exchange Server. Stock Exchange Server processes/fulfills the request, creates a response message and places it in the ResponseSubmitQueue.

    Now assume that Stock Broker Server becomes unstable and has to be brought down.

  • Stock Broker Server is brought up. As soon as it is in a running state, Messaging Bridge2 forwards the response message from ResponseSubmitQueue to ResponseReceiveQueue. The Stock Broker Server stores the response in a flat file and displays it whenever the user wants to view it.

    This is just one example, but as we saw above, no messages were lost and there was no application logic required to do any additional processing when the target server was down.

    Features Provided by the Message Bridge
    By using the message bridge in the sample application, there was no runtime dependency between the two applications. Any one of the applications can be down and it will not impact the second application. Basically, all the messages on the first server will be queued and the messaging bridge will automatically start sending messages to the target destination as soon as the second server is up and running. It provides flexibility when you have the Stock Broker Application and Stock Exchange Application deployed on different versions of WebLogic. The Stock Broker Application and Stock Exchange Application can run on any version of WebLogic, which allows loose coupling in terms of software infrastructure.

    One more advantage is that it also provides future flexibility to go with a completely different JMS implementation (e.g., MQSeries) or a non-JMS messaging product (Tuxedo) for Stock Exchange Application.

    Configuring JMX Queues

    Following are the steps required in setting up the JMS Bridge. The steps required for both servers are provided. (Note: We will use the notation of step A to signify that we are working on Stock Broker Server [BEA WebLogicServer 8.1], whereas step B signifies that we are working on Stock Exchange Server [BEA WebLogic Server 7.0]. Also, the screenshots of the BEA WebLogic Administration Console are provided only for Stock Broker Server, as a very similar configuration was used on both servers.)

    Configure a JMS Connection Factory For Stock Broker Server
    Using the WebLogic Administration Console, go to stockBrokerDomain > Services > JMS > Connection Factories. Click on "Configure a new JMS Connection Factory"

    1. The Name and JNDI Name have been specified as: SB_JMSConnectionFactory.
    2. All the other values have been set to default values (see Figure 2).
    3. Select the Transactions tab and check the box for "XA Connection Factory Enabled". This is required if your application uses transactions across the messaging bridge and if you specify the "Quality of Service" of the messaging bridge as "Exactly-once".
    For Stock Exchange Server
    Using the WebLogic Administration Console, go to stockExchangeDomain > Services > JMS > Connection Factories. Click on "Configure a new JMS Connection Factory".
    1. The Name and JNDI Name have been specified as SE_JMSConnectionFactory.
    2. All other values have been set to default values.
    3. Select the Transactions tab, check the box for "User Transactions Enabled", and click on the "Apply" button. Then check the box for "XA Connection Factory Enabled" and click on the "Apply" button. ("User Transactions Enabled" must be checked first, as there is a known bug in BEA WebLogic 7.0.) These steps are required if your application uses transactions across the messaging bridge and if you specify the "Quality of Service" of the messaging bridge as "Exactly-once".
    Configure a JMS Server For Stock Broker Server
    Using the WebLogic Administration Console, go to stockBrokerDomain > Services > JMS > Servers. Click on "Configure a new JMS Server".
    1. The Name has been specified as SB_JMSServer.
    2. All other values have been set to default values (see Figure 3).
    For Stock Exchange Server
    Using WebLogic Administration Console, go to stockExchageDomain > Services > JMS > Servers. Click on "Configure a new JMS Server".
    1. The Name has been specified as SE_JMSServer.
    2. All other values have been set to default values.
    Configure JMS Queues For Stock Broker Server
    Using the WebLogic Administration Console, go to stockBrokerDomain > Services > JMS > Servers > JMSServer > Destinations.
    1. Click on "Configure a new JMS Queue".
      a. The Name and JNDI Name have been specified as RequestSubmitQueue.
      b. All the other values have been set to default values (see Figure 4).
    2. Click on "Configure a new JMS Queue".
      a. The Name and JNDI Name have been specified as ResponseReceiveQueue.
      b. All the other values have been set to default values.
    For Stock Exchange Server
    Using the WebLogic Administration Console, go to stockExchangeDomain > Services > JMS > Servers > JMSServer > Destinations.
    1. Click on "Configure a new JMS Queue".
      a. The Name and JNDI Name have been specified as: RequestReceiveQueue.
      b. All other values have been set to default values.
    2. Click on "Configure a new JMS Queue".
      a. The Name and JNDI Name have been specified as ResponseSubmitQueue.
      b. All the other values have been set to default values.
    Deploy the JMS Transaction Adapter in the Application Domain For Stock Broker Server
    Using the WebLogic Administration Console, go to stockBrokerDomain > Deployments > Connector Module. Click on "Deploy a new Connector Module" and upload the jms-xa-adp.rar file from WebLogic's server/lib directory.

    For Stock Exchange Server
    Using the WebLogic Administration Console, go to stockExchangeDomain > Deployments > Connector Modules. Click on "Deploy a new Connector Module" and upload the jms-xa-adp.rar file from the WebLogic Server/lib directory.

    Configure JMS Bridge Destinations For Stock Broker Server
    Using the WebLogic Administration Console, go to stockBrokerDomain > Services > Messaging Bridge > JMS Bridge Destinations.

    1.  Click on "Configure a new JMS Bridge Destination". These values have been set:

    Name: JMSBridge1Source
    Adapter JNDI Name: eis.jms.WLSConnectionFactoryJNDIXA (default value, but this resource adapter needs to be deployed for the bridge to function properly) Connection URL: t3://localhost:7001 (the URL of the Stock Broker Server) Connection Factory JNDI Name: SB_JMSConnectionFactory (the connection factory that we created earlier) Destination JNDI Name: RequestSubmitQueue (the queue that JMSBridge1Source is trying to read the messages from) Destination Type: Queue (optional username/password that the adapter will use to access this bridge destination). If you specify username/password, the following step is required:
    a. Go to stockBrokerDomain > Security.Select Advanced tab
    - Uncheck "Enable Generated Credential".
    - Specify the new credential and make sure that it is set to the same value across the two application domains (stockBrokerDomain and stock ExchangeDomain).

    All other values have been set to default values (see Figure 5). 2.  Click on "Configure a new JMS Bridge Destination". These values have been set:

    Name: JMSBridge1Destination
    Adapter JNDI Name: eis.jms.WLSConnectionFactoryJNDIXA (default value, but this resource adapter must be deployed for the bridge to function properly) Connection URL: t3://localhost:7003 (the URL of the Stock Exchange Server, which is the server on which the bridge's target destination is running.) Connection Factory JNDI Name: SE_JMSConnectionFactory (the connection factory that we created earlier). Destination JNDI Name: RequestReceiveQueue (the queue where JMSBridgeDestination will place the new messages that were transferred over the bridge) Destination Type: Queue. (An optional username/password that the adapter will use to access this bridge destination can also be set. If you specify the username/password, please set up credentials.)

    All other values have been set to default values.

    Configure JMS Bridge Destinations for Server B
    Using the WebLogic Administration Console, go to server2Domain > Services > Messaging Bridge > JMS Bridge Destinations.

    1.  Click on "Configure a new JMS Bridge Destination". These values have been set:

    Name: JMSBridge2Source
    Connection URL: t3://localhost:7003 (the URL of the Stock Exchange Server). Connection Factory JNDI Name: SE_JMSConnectionFactory (the connection factory we created earlier). Destination JNDI Name: ResponseSubmitQueue (the queue that JMSBridgeSource is trying to read the messages from) Destination Type: Queue. (An optional username/password that the adapter will use to access this bridge destination can also be set. If you specify the username/password please set up credentials.)

    All other values have been set to default values.

    2.  Click on "Configure a new JMS Bridge Destination". The values have been set.

    Name: JMSBridge2Destination
    Connection URL: t3://localhost:7001 (the URL of the Stock Broker Server, which is the server on which the bridge's target destination is running). connection factory JNDI Name: SB_JMSConnectionFactory (the connection factory we created earlier) Destination JNDI Name: ResponseReceiveQueue (This is the queue in which JMSBridgeDestination will place the new messages that were transferred over the bridge) Destination Type: Queue. (An optional username/password that the adapter will use to access this bridge destination can also be set. If you specify the username/password, please set up credentials.)

    All other values have been set to default values.

    Configure Messaging Bridge(s) On Stock Broker Server (Stock Broker > Stock Exchange)
    Using the WebLogic Administration Console, go to stockBrokerDomain > Services > Messaging Bridge > Bridges.

    Click on "Configure a new Messaging Bridge Destination". These values have been set:

    Name: JMSMessagingBridge1
    Source Bridge Destination: JMSBridge1Source
    Target Bridge Destination: JMSBridgeDestination
    Quality of Service: Exactly-once (Make sure that XA Connection Factory is enabled for the JMSConnectionFactory created earlier, along with deploying the bridge resource adapter described earlier.)

    All other values have been set to default values (see Figure 6).

    On Stock Exchange Server (Stock Exchange > Stock Broker)
    Using WebLogic Administration Console, go to stockExchangeDomain > Services > Messaging Bridge > Bridges. Click on "Configure a new Messaging Bridge Destination". These values have been set:

    Name: JMSMessagingBridge2
    Source Bridge Destination: JMSBridge2Source (4.5.B.1)
    Target Bridge Destination: JMSBridge2Destination (4.5.B.2)
    Quality of Service: Exactly-once (make sure that XA Connection Factory is enabled for the JMSConnectionFactory created earlier, along with deploying the bridge resource adapter)

    All other values have been set to default values.

    Summary

    The BEA WebLogic Messaging Bridge is a J2EE device provided by WebLogic (from version 6.1 onward) and is used to transfer messages between two JMS providers. You can use the message bridge to move messages from a destination in one JMS provider to destination in another JMS provider. (One example could be transferring a message in a queue on the WebLogic JMS server to a topic in Sonic MQ JMS Server)

    In addition to offering interoperability between different JMS providers, the bridge also allows interoperability between different versions of WebLogic JMS. Although the bridge itself will run on version 7.0 or greater, it can be used to forward messages to destinations running on version 5.1 and greater.

    No coding is required; it is purely configuration. There is a built-in capability to ensure quality of service and connection management (Exactly-once, Duplicates-okay, and Atmost-once). It is easy to configure multiple bridges, and there is an ability to dynamically start and stop individual bridges.

    References

  • Configuration of Messaging Bridge: http://edocs.bea.com/wls/docs81/ConsoleHelp/domain_messagingbridge_con fig_general.html
  • Console Help: http://edocs.bea.com/wls/docs70/ConsoleHelp/messaging_bridge.html
  • Using the BEA WebLogic Messaging Bridge: http://edocs.bea.com/wls/docs70/adminguide/msgbridge.html
  • Enterprise Integration Patterns: www.enterpriseintegrationpatterns.com/MessagingBridge.html
  • More Stories By Vijay Chinta

    Vijay Chinta is an enterprise architect at Nokia. His primary area of expertise is J2EE development for enterprise applications in the fields of telecommunication and transportation.

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


    @ThingsExpo Stories
    The 22nd International Cloud Expo | 1st DXWorld Expo has announced that its Call for Papers is open. Cloud Expo | DXWorld Expo, to be held June 5-7, 2018, at the Javits Center in New York, NY, brings together Cloud Computing, Digital Transformation, Big Data, Internet of Things, DevOps, Machine Learning and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding busin...
    Smart cities have the potential to change our lives at so many levels for citizens: less pollution, reduced parking obstacles, better health, education and more energy savings. Real-time data streaming and the Internet of Things (IoT) possess the power to turn this vision into a reality. However, most organizations today are building their data infrastructure to focus solely on addressing immediate business needs vs. a platform capable of quickly adapting emerging technologies to address future ...
    Nordstrom is transforming the way that they do business and the cloud is the key to enabling speed and hyper personalized customer experiences. In his session at 21st Cloud Expo, Ken Schow, VP of Engineering at Nordstrom, discussed some of the key learnings and common pitfalls of large enterprises moving to the cloud. This includes strategies around choosing a cloud provider(s), architecture, and lessons learned. In addition, he covered some of the best practices for structured team migration an...
    No hype cycles or predictions of a gazillion things here. IoT is here. You get it. You know your business and have great ideas for a business transformation strategy. What comes next? Time to make it happen. In his session at @ThingsExpo, Jay Mason, an Associate Partner of Analytics, IoT & Cybersecurity at M&S Consulting, presented a step-by-step plan to develop your technology implementation strategy. He also discussed the evaluation of communication standards and IoT messaging protocols, data...
    With tough new regulations coming to Europe on data privacy in May 2018, Calligo will explain why in reality the effect is global and transforms how you consider critical data. EU GDPR fundamentally rewrites the rules for cloud, Big Data and IoT. In his session at 21st Cloud Expo, Adam Ryan, Vice President and General Manager EMEA at Calligo, examined the regulations and provided insight on how it affects technology, challenges the established rules and will usher in new levels of diligence arou...
    In his Opening Keynote at 21st Cloud Expo, John Considine, General Manager of IBM Cloud Infrastructure, led attendees through the exciting evolution of the cloud. He looked at this major disruption from the perspective of technology, business models, and what this means for enterprises of all sizes. John Considine is General Manager of Cloud Infrastructure Services at IBM. In that role he is responsible for leading IBM’s public cloud infrastructure including strategy, development, and offering m...
    In his session at 21st Cloud Expo, Raju Shreewastava, founder of Big Data Trunk, provided a fun and simple way to introduce Machine Leaning to anyone and everyone. He solved a machine learning problem and demonstrated an easy way to be able to do machine learning without even coding. Raju Shreewastava is the founder of Big Data Trunk (www.BigDataTrunk.com), a Big Data Training and consulting firm with offices in the United States. He previously led the data warehouse/business intelligence and B...
    Recently, REAN Cloud built a digital concierge for a North Carolina hospital that had observed that most patient call button questions were repetitive. In addition, the paper-based process used to measure patient health metrics was laborious, not in real-time and sometimes error-prone. In their session at 21st Cloud Expo, Sean Finnerty, Executive Director, Practice Lead, Health Care & Life Science at REAN Cloud, and Dr. S.P.T. Krishnan, Principal Architect at REAN Cloud, discussed how they built...
    22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, and co-located with the 1st DXWorld Expo will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud ...
    22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, and co-located with the 1st DXWorld Expo will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud ...
    DevOps at Cloud Expo – being held June 5-7, 2018, at the Javits Center in New York, NY – announces that its Call for Papers is open. Born out of proven success in agile development, cloud computing, and process automation, DevOps is a macro trend you cannot afford to miss. From showcase success stories from early adopters and web-scale businesses, DevOps is expanding to organizations of all sizes, including the world's largest enterprises – and delivering real results. Among the proven benefits,...
    @DevOpsSummit at Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, is co-located with 22nd Cloud Expo | 1st DXWorld Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time to wait...
    Cloud Expo | DXWorld Expo have announced the conference tracks for Cloud Expo 2018. Cloud Expo will be held June 5-7, 2018, at the Javits Center in New York City, and November 6-8, 2018, at the Santa Clara Convention Center, Santa Clara, CA. Digital Transformation (DX) is a major focus with the introduction of DX Expo within the program. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive ov...
    SYS-CON Events announced today that T-Mobile exhibited at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. As America's Un-carrier, T-Mobile US, Inc., is redefining the way consumers and businesses buy wireless services through leading product and service innovation. The Company's advanced nationwide 4G LTE network delivers outstanding wireless experiences to 67.4 million customers who are unwilling to compromise on qua...
    SYS-CON Events announced today that Cedexis will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Cedexis is the leader in data-driven enterprise global traffic management. Whether optimizing traffic through datacenters, clouds, CDNs, or any combination, Cedexis solutions drive quality and cost-effectiveness. For more information, please visit https://www.cedexis.com.
    SYS-CON Events announced today that Google Cloud has been named “Keynote Sponsor” of SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Companies come to Google Cloud to transform their businesses. Google Cloud’s comprehensive portfolio – from infrastructure to apps to devices – helps enterprises innovate faster, scale smarter, stay secure, and do more with data than ever before.
    SYS-CON Events announced today that Vivint to exhibit at SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California. As a leading smart home technology provider, Vivint offers home security, energy management, home automation, local cloud storage, and high-speed Internet solutions to more than one million customers throughout the United States and Canada. The end result is a smart home solution that sav...
    SYS-CON Events announced today that Opsani will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Opsani is the leading provider of deployment automation systems for running and scaling traditional enterprise applications on container infrastructure.
    SYS-CON Events announced today that Nirmata will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Nirmata provides a comprehensive platform, for deploying, operating, and optimizing containerized applications across clouds, powered by Kubernetes. Nirmata empowers enterprise DevOps teams by fully automating the complex operations and management of application containers and its underlying ...
    SYS-CON Events announced today that Opsani to exhibit at SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California. Opsani is creating the next generation of automated continuous deployment tools designed specifically for containers. How is continuous deployment different from continuous integration and continuous delivery? CI/CD tools provide build and test. Continuous Deployment is the means by which...