7 How to Configure the Oracle Tuxedo Queuing Bridge

This chapter provides information on the Tuxedo queuing bridge functionality and configuration.

This chapter includes the following sections:

Overview of the Tuxedo Queuing Bridge

The Tuxedo queuing bridge is a part of the Oracle WebLogic Tuxedo Connector that provides a bi-directional JMS interface for your WebLogic Server applications to communicate to Tuxedo application environments. The transfer of messaging between the environments consists of JMS based messages containing text, Byte, or XML data streams used to invoke services on behalf of the client application.

Figure 7-1 Interaction between WebLogic Server and Tuxedo with queuing bridge

Description of Figure 7-1 follows
Description of "Figure 7-1 Interaction between WebLogic Server and Tuxedo with queuing bridge"

The following features determine the functionality of the Tuxedo queuing bridge:

  • Connectivity is determined by the configuration of the attributes in the Tuxedo queuing bridge and redirections of your WTC server.

  • The Tuxedo queuing bridge uses Java Messaging Service (JMS) to provide an interface to a Tuxedo /Q or a Tuxedo service.

  • The Tuxedo queuing bridge provides simple translation between XML and FML32 to provide connectivity to existing Tuxedo systems.

How Tuxedo Queuing Bridge connects JMS with Tuxedo

This section provides information on how JMS messages flow through the Tuxedo queuing bridge to Tuxedo queues and services.

Note:

Messages remain on the JMS queue until they have been acknowledged.

  1. A JMS client, such as a web enabled WLPI application, places a message to be processed by Tuxedo on a JMS Queue. If this message was part of a transaction, the transaction commits.

  2. The message is removed from the JMS queue to be processed by the Tuxedo Queuing Bridge Converter.

  3. The Tuxedo Queuing Bridge Converter checks the message type and converts supported JMS types to JATMI buffer types.

    1. BytesMessage, TextMessage, XML are converted respectively to TypedCArray, TypedString, and TypedFML32. XML/FML translation is performed according to the TranslateFML attribute.

    2. Translation errors are sent to the wlsServerErrorDestination queue and the message is acknowledged in the JMS session.

    3. If an unrecognized JMS message is received: an appropriate error message is logged, the message is acknowledged, and then is discarded. This is considered a configuration error and the Tuxedo queuing bridge does not redirect the message to the error queue.

  4. The converted message is sent to Tuxedo using the TDomain gateway.

    1. Messages with a redirect set to JmsQ2TuxQ use JATMI tpenqueue to deliver the message to a Tuxedo queue.

    2. Messages with a redirect set to JmsQ2TuxS use JATMI tpcall to deliver the message to a Tuxedo service.

  5. The tpenqueue is successful or tpcall is successful and the return results are placed in the replyQ. The message is acknowledged in the JMS session.

    If the tpenqueue or tpcall fails, Tuxedo queuing bridge delivers the message to the wlsServerErrorDestination queue and the message is acknowledged in the JMS session. If a wlsServerErrorDestination queue is not configured, the message is discarded and the Tuxedo queuing bridge processes the next available unacknowledged message.

How Tuxedo Queuing Bridge connects Tuxedo to JMS

This section provides information on how Tuxedo messages flow through the Tuxedo queuing bridge to a JMS queue using the TuxQ2JmsQ redirect.

Note:

Tuxedo queuing bridge uses a transaction to prevent the loss of messages while transferring messages from Tuxedo /Q to a JMS queue.

  1. Tuxedo queuing bridge polls the Tuxedo queue for available messages.

  2. A Tuxedo service places a message on a Tuxedo queue.

  3. Tuxedo queuing bridge uses JATMI tpdequeue to forward the message from Tuxedo and places the message in the JMS queue.

    • If a message cannot be redirected to a JMS queue for any reason after the specified retries have been exhausted, the message is put into the tuxErrorDestination queue within the same queue space as the Tuxedo queue.

    • If the Tuxedo queuing bridge is not able to put the message into the tuxErrorDestination queue for any reason, an error is logged and the message is lost.

    • If the tuxErrorDestination queue is not specified, the message is lost.

Tuxedo Queuing Bridge Limitations

The Tuxedo queuing bridge has the following limitations:

  • Transactions are not used when retrieving messages from the JMS location and placing them on the Tuxedo queue or invoking a Tuxedo service.

  • Tuxedo queuing bridge is thread intensive. A thread is used to transport each message from JMS queue to Tuxedo. A polling thread is required to monitor the configured Tuxedo queue.

  • The XML/FML translator is intended to construct simple message structures. See, FML32 Considerations in Developing Oracle WebLogic Tuxedo Connector Applications for Oracle WebLogic Server.

Configuring the Tuxedo Queuing Bridge

Tuxedo queuing bridge connectivity is determined by configuring the attributes in the Tuxedo queuing bridge and redirections of your WTC server. These attributes contain the necessary information to establish a connection to Tuxedo.

A complete Tuxedo queuing bridge configuration requires the following:

  • Configure one queuing bridge

  • Configure one or more redirections

Dynamically Adding/Modifying Tuxedo Queuing Bridge

Typically, after a complete Tuxedo queuing bridge configuration exists and WTC is deployed, the Tuxedo queuing bridge is activated. After the Tuxedo queuing bridge is active, no additions or modifications to the configuration can occur without shutting the WTC queuing bridge down.

If WTC is activated and the Tuxedo queuing bridge is deactivated, the following additions and modifications are possible.

  • Add WTC queuing bridge if there is no WTC queuing bridge configuration

  • Modify WTC queuing bridge

  • Delete WTC queuing bridge

  • Add WTC redirections

  • Modify WTC redirections

  • Delete WTC redirections

After completing the WTC queuing bridge configuration changes, you must activate the changes.

Note:

Dynamically adding/modifying Tuxedo queuing bridge is only possible if the queuing bridge is not activated. WTC can be activated, but the queuing bridge must not be activated. To shut down the WTC queuing bridge, you should deactivate the WTC server.

Tuxedo Queuing Bridge Instantiate

If, and only if, a complete WTC queuing bridgequeuing bridge configuration is available at the time of activation will WTC start the Tuxedo queuing bridge.

If the WTC queuing bridge configuration is incomplete, then no Tuxedo queuing bridge instance is available.

Starting the Tuxedo Queuing Bridge

The Tuxedo queuing bridge is started as part of the WebLogic Server application environment if the Tuxedo queuing bridge and redirections of your WTC server are configured and the WTC server is deployed to a target server. Any configuration condition that prevents the Tuxedo queuing bridge from starting results in an error being logged.

Error Logging

Oracle WebLogic Tuxedo Connector errors are logged to the WebLogic Server error log.

Tuxedo Queuing Bridge Connectivity

The Tuxedo queuing bridge establishes a one-way data connection between instances of a JMS queue and a Tuxedo /Q or a JMS queue and a Tuxedo service. This connection is represented by the Tuxedo queuing bridge and redirections configurations of your WTC server and provides a one-to-one connection between the identified points. Three types of connections can be configured. The following is a description of each of the connection types:

  • JmsQ2TuxQ: Reads from a given JMS queue and transports the messages to the specified Tuxedo /Q.

  • TuxQ2JmsQ: Reads from a Tuxedo /Q and transports the messages to JMS.

  • JmsQ2TuxS: Reads from a given JMS queue, synchronously calls the specified Tuxedo service, and places the reply back onto a specified JMS queue.

    Note:

    JMS message types: MapMessage, ObjectMessage, StreamMessage are not valid in Oracle WebLogic Tuxedo Connector. If one of these message types is received by the Tuxedo queuing bridge, a log entry is generated indicating this is an unsupported type and the message is discarded.

Example Connection Type Configurations

The following sections provide example configurations for each connection type.

Example JmsQ2TuxQ Configuration

The following section provides an example configuration in the config.xml file for reading from a JMS queue and sending to Tuxedo /Q.

<wtc-tbridge-redirect>
     <direction>JmsQ2TuxQ</direction>
     <name>redir0</name>
     <reply-q>RPLYQ</reply-q>
     <source-name>weblogic.jms.Jms2TuxQueue</source-name>
     <target-access-point>TDOM2</target-access-point>
     <target-name>STRING</target-name>
     <target-qspace>QSPACE</target-qspace>
     <translate-fml>NO</translate-fml>
</wtc-tbridge-redirect>

The following section describes the components of the JmsQ2TuxQ configuration:

  • The Direction connection type is JmsQ2TuxQ.

  • Source Name specifies the name of the JMS queue to read is weblogic.jms.Jms2TuxQueue. The Tuxedo queuing bridge establishes a JMS client session to this queue using CLIENT_ACKNOWLEDGE semantics.

  • Target Access Point specifies the name of the access point is TDOM2.

  • Target Qspace specifies the name of the Qspace is Qspace.

  • Target Name specifies the name of the queue is STRING.

  • ReplyQ specifies the name of a JMS reply queue is RPLYQ. Use of this queue causes tpenqueue to provide TMFORWARD functionality.

  • TranslateFML set to NO specifies that no data translation is provided by the Tuxedo queuing bridge.

Table 7-1 provides information on JmsQtoTuxQ message mapping.

Table 7-1 JmsQ to TuxQ Message Mapping

From: JMS Message Type To: Oracle WebLogic Tuxedo Connector JATMI (Tuxedo)

BytesMessage

TypedCArray

TextMessage (translateFML = NONE)

TypedString

TextMessage (translateFML = FLAT)

TypedFML32

Example TuxQ2JmsQ Configuration

The following section provides an example configuration in the config.xml file for reading from a Tuxedo /Q and sending to a JMS queue.

<wtc-tbridge-redirect>
     <direction>TuxQ2JmsQ</direction>
     <name>redir1</name>
     <source-access-point>TDOM2</source-access-point>
     <source-name>STRING</source-name>
     <source-qspace>QSPACE</source-qspace>
     <target-name>weblogic.jms.Tux2JmsQueue</target-name>
     <translate-fml>NO</translate-fml>
</wtc-tbridge-redirect>

The following section describes the components of the TuxQ2JmsQ configuration:

  • The Direction connection type is TuxQ2JmsQ.

  • Target Name specifies the name of the JMS queue to read is weblogic.jms.Tux2JmsQueue.

  • Source Access Point specifies the name of the access point is TDOM2.

  • Source Qspace specifies the name of the Qspace is Qspace.

  • Source Name specifies the name of the queue is STRING.

  • TranslateFML set to NO specifies that no data translation is provided by the Tuxedo queuing bridge.

  • TranslateFML set to Flat specifies that the data is translated from FML to XML by the Tuxedo queuing bridge.

Table 7-2 provides information on TuxQ2JmsQ message mapping:

Table 7-2 TuxQ2JmsQ Message Mapping

From: Oracle WebLogic Tuxedo Connector JATMI (Tuxedo) To: JMS Message Type

TypedCArray

BytesMessage

TypedString (translateFML = NO)

TextMessage

TypedFML32 (translateFML = FLAT)

TextMessage

TypedFML (translateFML = FLAT)

TextMessage

TypedXML

TextMessage

Example JmsQ2TuxS Configuration

The following section provides an example configuration in the config.xml file for reading from a JMS queue, calling a Tuxedo service, and then writing the results back to a JMS queue.

<wtc-tbridge-redirect>
     <direction>JmsQ2TuxS</direction>
     <name>redir0</name>
     <replyq>weblogic.jms.Tux2JmsQueue</replyq>
     <source-name>weblogic.jms.Jms2TuxQueue</source-name>
     <target-access-point>TDOM2</target-access-point>
     <target-name>TOUPPER</target-name>
     <translate-fml>FLAT</translate-fml>
</wtc-tbridge-redirect>

The following section describes the components of the JmsQ2TuxS configuration:

  • The Direction connection type is JmsQ2TuxS.

  • Source Name specifies the name of the JMS queue to read is weblogic.jms.Jms2TuxQueue.

  • Target Access Point specifies the name of the access point is TDOM2.

  • Target Name specifies the name of the queue is TOUPPER.

  • ReplyQ specifies the name of the JMS reply queue is weblogic.jms.Tux2JmsQueue.

  • TranslateFML set to FLAT specifies that when a JMS message is received, the message is in XML format and is converted into the corresponding FML32 data buffer. The message is then placed in a tpcall with arguments TDOM2 and TOUPPER. The resulting message is then translated from FML32 into XML and placed on the weblogic.jms.Tux2JmsQueue.

Table 7-3 provides information on the JMSQ2TuxX message mapping:

Table 7-3 JMSQ2TuxX Message Mapping

JMS Message Type Oracle WebLogic Tuxedo Connector JATMI (Tuxedo) JMS Message Type

BytesMessage

TypedCArray

BytesMessage

TextMessage (translateFML = NONE)

TypedString

TextMessage

TextMessage (translateFML = FLAT)

TypedFML32

TextMessage

Note:

There may be scenarios where a reply from Tuxedo is returned and the translateFML parameter has no effect. Translation may occur automatically.

See Using FML with WebLogic Tuxedo Connector in Developing Oracle WebLogic Tuxedo Connector Applications for Oracle WebLogic Server.

Priority Mapping

Oracle WebLogic Tuxedo Connector supports multiple Tuxedo queuing bridge redirect instances. In many environments, using multiple redirect instances significantly improves application scalability and performance. However, it does randomizes the order in which messages are processed. Although priority mapping does not guarantee ordering, it does provides a mechanism to react to messages based on an assigned importance. If the order of delivery must be guaranteed, use a single Tuxedo queuing bridge redirect instance.

Use Priority Mapping to map priorities between the JMS and Tuxedo.

  • JMS has ten priorities (0 - 9).

  • Tuxedo/Q has 100 priorities (1 - 100).

This section provides a mechanism to map the priorities between the Tuxedo and JMS subsystems. There are two mapping directions:

  • JmstoTux

  • TuxtoJms

Defaults are provided for all values, shown below in pairs of value:range.

  • The value specifies the given input priority.

  • The range specifies a sequential group of resulting output priorities.

JmstoTux- 0:1 | 1:12 | 2:23 | 3:34 | 4:45 | 5:56 | 6:67 | 7:78 | 8:89 | 9:100
TuxtoJms- 0:1-10|1:11-20|2: 21-30|3: 31-40|4: 41-50|5:51-60|6: 61-70|7:71-80|8:81-90|9:91-100

For this configuration, a JMS message of priority 7 is assigned a priority of 78 in the Tuxedo /Q. A Tuxedo /Q with a priority of 47 is assigned a JMS priority of 4.

Error Queues

When Tuxedo queuing bridge encounters a problem retrieving messages from Tuxedo Queue or JMS Queue after the retry interval:

  • The information is logged.

  • The message is saved in the error queue if it is configured.

WLS Error Destination

The WLS Error Destination queue is used if a JMS message cannot be properly delivered due to Tuxedo failure or a translation error.

Unsupported Message Types

If an unrecognized JMS message is received, an appropriate error message is logged and the message is discarded. This is considered a configuration error and the Tuxedo queuing bridge does not redirect the message to the error queue.

Tuxedo Error Queue

The Tuxedo Error Queue is the failure queue for the JATMI primitive tpdequeue during a TuxQ2JmsQ redirect.

Limitations

The Tuxedo queuing bridge error queues have the following limitations:

  • Tuxedo Error Destination can be specified only once. Any error queue name associated with the ErrorDestination implies that all the QSPACEs have the same error queue name available.

  • When there is an error, the message is put back in the source QSPACE. Assuming the QSPACE is corrupted or full, subsequent messages would be lost.

  • There is no way to drop messages on error. All messages are received or none are received.

  • Information about the error is only available in the server log.