|
WebLogic Server 6.1 Code Examples, BEA Systems, Inc. | |||||
There are three types of communication pathways that can be configured with the tBridge:
simpapp example.
simpapp example, you are ready run the tBridge example.
simpapp example.
<tBridge></tBridge> section after the </BDMCONFIG>. For this example, we
reference the Tuxedo service TOUPPER used in simpapp example.
An example tBridge WTC_CONFIG.XML file is located in the tBridge example directory.
<?xml version="1.0"?>
<!DOCTYPE WTC_CONFIG SYSTEM
"http://www.bea.com/servers/wls610/dtd/wtc_config_1_0.dtd">
<WTC_CONFIG>
<BDMCONFIGA>
<T_DM_LOCAL_TDOMAIN AccessPoint="TDOM2">
<WlsClusterName>MyCluster</WlsClusterName>
<AccessPointId>TDOM2</AccessPointId>
<Type>TDOMAIN</Type>
<Security>NONE</Security>
<ConnectionPolicy>ON_DEMAND</ConnectionPolicy>
<BlockTime>30</BlockTime>
<NWAddr>[Network address of WTC domain]</NWAddr>
<!-- Example address: //mydomain.acme.com:20304 -->
</T_DM_LOCAL_TDOMAIN>
<T_DM_REMOTE_TDOMAIN AccessPoint="TDOM1">
<LocalAccessPoint;TDOM2</LocalAccessPoint>
<AccessPointId>MYDOMAIN</AccessPointId>
<Type>TDOMAIN</Type>
<NWAddr>[Network address of Tuxedo domain]</NWAddr>
<!-- Example address: //mydomain.acme.com:20305 -->
</T_DM_REMOTE_TDOMAIN>
<T_DM_IMPORT
ResourceName="TOUPPER"
LocalAccessPoint="TDOM2"
RemoteAccessPointList="TDOM1">
<TranTime>600</TranTime>
</T_DM_IMPORT>
</BDMCONFIG>
<tBridge>
<redirect>
<fromto>
<direction>JmsQ2TuxS</direction>
<source>
<Name>weblogic.jms.Jms2TuxQueue</Name>
</source>
<target>
<AccessPoint>TDOM2</AccessPoint>
<Name>TOUPPER</Name>
</target>
<replyQ>weblogic.jms.Tux2JmsQueue</replyQ>
<translateFML>No</translateFML>
</fromto>
</redirect>
<timeout>60</timeout>
<wlsErrorDestination>weblogic.jms.tBerrorQueue</wlsErrorDestination>
<jndiFactory>weblogic.jndi.WLInitialContextFactory</jndiFactory>
<jmsFactory>weblogic.jms.ConnectionFactory</jmsFactory>
<tuxFactory>tuxedo.services.TuxedoConnection</tuxFactory>
</tBridge>
</WTC_CONFIG>
This configuration specifies that the tBridge reads a message from a JMS
queue, transfers it to a Tuxedo service and returns the reply to a JMS queue.
<direction> keyword is JmsQ2TuxS.
<source> <Name> keyword specifies the name of the JMS queue to read
is weblogic.jms.Jms2TuxQueue.
<target> specifies the elements necessary to explicitly reference the
destination.
<AccessPoint> keyword specifies the name of the access point is TDOM2.
<Name> keyword specifies the Tuxedo service name to be called: TPUPPER.
<replyQ> keyword specifies the name of a JMS reply queue is
weblogic.jms.Tux2JmsQueue.
CONFIG.XML file must be edited to
add the following statements:
<JMSQueue JNDIName="weblogic.jms.Jms2TuxQueue" Name="Jms2TuxQueue" StoreEnabled="default"/> <JMSQueue JNDIName="weblogic.jms.Tux2JmsQueue" Name="Tux2JmsQueue" StoreEnabled="default"/>
config.xml file to add a JMS server.
<JMSServer
Name="TestJMSServer"
Targets="myserver">
<JMSQueue
JNDIName="weblogic.jms.Jms2TuxQueue"
Name="Jms2TuxQueue"/>
<JMSQueue
JNDIName="weblogic.jms.Tux2JmsQueue"
Name="Tux2JmsQueue"/>
</JMSServer>
simpapp example.
simpapp example, you are ready run the tBridge example.
simpapp example.
Execute the client code using the run command to demonstrate that the TOUPPER EJB is functional.
tBfrom2jms by using the following command:
java weblogic.wtc.tbridge.tBfrom2jms t3://localhost:7001The routine should respond indicating that it is waiting for a JMS message.
java weblogic.wtc.tbridge.tBsend2jms t3://localhost:7001
tBsend2jms routine indicates that it is waiting for terminal input.
tBsend2jms window, type in a text string such as "Hello"
tBfrom2jms window responds with "HELLO"
weblogic.jms.Jms2TuxQueue and send the message to
the Tuxedo /Q QSPACE named STRING with the reply queue set to RPLYQ.
weblogic.jms.Tux2JmsQueue.
<fromto>
<direction>JmsQ2TuxQ</direction>
<source>
<Name>weblogic.jms.Jms2TuxQueue</Name>
</source>
<target>
<AccessPoint>TDOM2</AccessPoint>
<Qspace>QSPACE</Qspace>
<Name>STRING</Name>
</target>
<replyQ>RPLYQ</replyQ>
<translateFML>NO</translateFML>
</fromto>
<fromto>
<direction>TuxQ2JmsQ</direction>
<source>
<AccessPoint>TDOM2</AccessPoint>
<Qspace>QSPACE</Qspace>
<Name>STRING</Name>
</source>
<target>
<Name>weblogic.jms.Tux2JmsQueue</Name>
</target>
<translateFML>NO</translateFML>
</fromto>
This example uses the same configuration WebLogic Server and Tuxedo configurations that are required for the simpFML32 example.
simpFML32 example, you are ready run the tBridge example.
simpFML32 example.
<fromto>
<direction>JmsQ2TuxS</direction>
<source>
<Name>weblogic.jms.Jms2TuxQueue</Name>
</source>
<target>
<AccessPoint>TDOM2</AccessPoint>
<Name>REVERSE_STRING</Name>
</target>
<replyQ>weblogic.jms.Tux2JmsQueue</replyQ>
<translateFML>FLAT</translateFML>
</fromto>
<T_DM_RESOURCES>
<FieldTables>
<FldTblClass
Type="fml32">weblogic.wtc.tbridge.tBtest2flds32</FldTblClass>
</FieldTables>
</T_DM_RESOURCES>
tBsend2jms and tBfrom2jms.
tBsend2jms, type the following simple XML message:
<XML><STRING>Hello</STRING></XML>
tBfrom2jms should display the
returned XML message:
<FML32><STRING>olleH</STRING></FML32>
For more information about WebLogic Server WebLogic Tuxedo Connector, see:
|
Documentation is available at http://e-docs.bea.com/wls/docs61/ |
|||||