WebLogic Server 7.0 Code Examples, BEA Systems, Inc.

Package examples.wtc.tBridge

The tBridge is an administratively configured process that provides a communication bridge between JMS and Tuxedo. This package contains the following examples:

The following sections provide information to configure the tBridge to communicate with JMS and Tuxedo using two simple routines provided with WebLogic Tuxedo Connector:

where:

Create a JMS Server and JMS queues

You must configure a JMS Server and three JMS queues:

Configure the JMS server and queues using the WebLogic Server console or by editing the WebLogic Server CONFIG.XML file as follows:


<JMSServer 
     Name="TestJMSServer" 
     Targets="examplesServer">
     <JMSQueue 
          JNDIName="weblogic.jms.Jms2TuxQueue" 
          Name="Jms2TuxQueue"/>
     <JMSQueue 
          JNDIName="weblogic.jms.Tux2JmsQueue" 
          Name="Tux2JmsQueue"/>
     <JMSQueue
          JNDIName="weblogic.jms.tBerrorQueue" 
          Name="tBerrorQueue"/>	 
</JMSServer>

Using tBridge with a Tuxedo Service

Use the following steps to interface tBridge with a Tuxedo Service:

Run the simpapp example

This example uses the same WebLogic Server and Tuxedo configurations required for the simpapp example. Successful execution demonstrates that the TOUPPER EJB is working correctly.

Configure the tBridge

  1. Make sure that the simpapp WTCServer Mbean is not targeted to the examplesServer.
  2. Copy the TuxS file located in the tBridge directory to your simpapp directory.
    • NT/2000 users copy the TuxS.cmd file. Unix users copy the TuxS.sh file.
  3. Edit the file and verify the url, username, and password. If required, modify the TuxS file with information specific to your installation.
    • NT/2000 users verify the TuxS.cmd file. Unix users verify the TuxS.sh file.
    • Set the url, user and passwd for your environment.
  4. Run the TuxS file to configure your installation.
    • NT/2000 users run the TuxS.cmd file.
    • Unix users run the TuxS.sh file.

Run the example

  1. Open a new shell and set the WebLogic Server environment variables. Run the tBfrom2jms routine by using the following command:
     java weblogic.wtc.tbridge.tBfrom2jms t3://localhost:7001
    The routine indicates that it is waiting for a JMS message.

  2. Open a second shell and set the WebLogic Server environment variables. Run the tBsend2jms routine using the following command:
     java weblogic.wtc.tbridge.tBsend2jms t3://localhost:7001
    The routine indicates that it is waiting for terminal input.

  3. In the tBsend2jms window, type in a text string such as "Hello"
  4. The tBfrom2jms window responds with "HELLO"

Using tBridge with Tuxedo /Q

The tBridge can interface with Tuxedo /Q using two directional connections:

Use the following steps to interface with Tuxedo /Q:

Run the qsample example

This example uses the same WebLogic Server and Tuxedo configurations required for the qsample example. Successful execution demonstrates that the EJB is working correctly.

Configure the tBridge

  1. Make sure that the qsample WTCServer Mbean is not targeted to the examplesServer.
  2. Copy the TuxQ file located in the tBridge directory to your qsample directory.
    • NT/2000 users copy the TuxQ.cmd file. Unix users copy the TuxQ.sh file.
  3. Edit the file and verify the url, username, and password. If required, modify the TuxQ file with information specific to your installation.
    • NT/2000 users verify the TuxQ.cmd file. Unix users verify the TuxQ.sh file.
    • Set the url, user and passwd for your environment.
  4. Run the TuxQ file to configure your installation.
    • NT/2000 users run the TuxQ.cmd file.
    • Unix users run the TuxQ.sh file.

Run the example

  1. Open a new shell and set the WebLogic Server environment variables. Run the tBfrom2jms routine by using the following command:
     java weblogic.wtc.tbridge.tBfrom2jms t3://localhost:7001
    The routine should respond indicating that it is waiting for a JMS message.

  2. Open a second shell and set the WebLogic Server environment variables. Run the tBsend2jms routine using the following command:
     java weblogic.wtc.tbridge.tBsend2jms t3://localhost:7001
    The routine indicates that it is waiting for terminal input.

  3. In the tBsend2jms window, type in a text string such as "Hello"
  4. The tBfrom2jms window responds with "HELLO"

FML/XML Conversion

The tBridge can do simple or "FLAT" FML/XML conversion. Use the following steps to send XML messages to the Tuxedo REVERSE_STRING FML32 based service and receive FML replies:

Run the simpfml32 example

This example uses the same WebLogic Server and Tuxedo configurations required for the simpfml32 example. Successful execution demonstrates that the EJB is working correctly.

Configure the tBridge

  1. Make sure that the simpfml32 WTCServer Mbean is not targeted to the examplesServer.
  2. Copy the XMLtoFML file located in the tBridge directory to your simpfml32 directory.
    • NT/2000 users copy the XMLtoFML.cmd file. Unix users copy the XMLtoFML.sh file.
  3. Edit the file and verify the url, username, and password. If required, modify the XMLtoFML file with information specific to your installation.
    • NT/2000 users verify the XMLtoFML.cmd file. Unix users verify the XMLtoFML.sh file.
    • Set the url, user and passwd for your environment.
  4. Run the XMLtoFML file to configure your installation.
    • NT/2000 users run the XMLtoFML.cmd file.
    • Unix users run the XMLtoFML.sh file.

Run the example

  1. Open a new shell and set the WebLogic Server environment variables.
  2. Run the tBfrom2jms routine by using the following command:
     java weblogic.wtc.tbridge.tBfrom2jms t3://localhost:7001
    The routine should respond indicating that it is waiting for a JMS message.

  3. Open a second shell and set the WebLogic Server environment variables. Run the tBsend2jms routine using the following command:
     java weblogic.wtc.tbridge.tBsend2jms t3://localhost:7001
    The routine indicates that it is waiting for terminal input.

  4. In the tBsend2jms window, type the following simple XML message: <XML><STRING>Hello</STRING></XML>
  5. The tBfrom2jms window displays the returned FML message: <FML32><STRING>olleH</STRING></FML32>

There's more...

For more information on the tBridge error message handling, message priority and correlation ID mapping, see the
WebLogic Tuxedo Connector Administration Guide.

For more information about WebLogic Server WebLogic Tuxedo Connector, see:


Documentation is available at
http://e-docs.bea.com/wls/docs70/

Copyright © 2000-2002 BEA Systems, Inc. All rights reserved.