How Do I: Create a Tuxedo Control That Uses Queue Type Services

When the service type is queue, the Tuxedo Control uses Tuxedo queuing services via tpenqueue and tpdequeue. As in other interaction styles, the data from the application to the Tuxedo queue is mapped based upon the method signature and the buffer type. The determination of whether a method is an enqueue, a dequeue, or both is determined by the method signature.

Warning: If an enqueue and dequeue is performed in the same queue with transaction attribute set to Supports, you will not see the enqueue message until the transaction commits. The dequeue will dequeue another message if one is in the queue or hang until the message is in the queue. If the dequeue hangs, you should turn off transaction support so that the dequeue can proceed.

Enqueue Behavior

The name of the queue space used to enqueue messages is determined by the sendQueueSpace attribute of the @TuxedoControl.tuxedo annotation. The sendQueueName attribute determines the queue name. The reply-queue-name determines the name of the reply queue to associate with the message. The failureQueueName gives the name of the failure queue to associate with the message.

Note: For information about using tmqforward, refer to Services Using tmqforward.

Dequeue Behavior

For dequeuing messages, the receive-queue-space, if set, determines the queue space; otherwise, the sendQueueSpace is used. This simply allows for you to only specify one queue space and it is used for both the enqueue and dequeue. The receive-queue-name attribute determines the queue name.

Create a Tuxedo Control for Queue Service Types

To specify using a queue service type you will create a Tuxedo Control file and then add a method to the control file.

  1. Select the web service to which you want to add a Tuxedo service.
  2. Right-click in the web services Design view or Source view and select Insert > Control. From the Select Control menu, choose New System Control > Tuxedo Control and click Ok. The New Control dialog displays.
  3. Select a location and name for the control and click Next. Note: The Tuxedo Control you create must be in a folder within the project.
  4. image

  5. Specify the following Tuxedo service attributes:
  6. Tuxedo Control Field
    Description

    Service Type

    Specify queue which supports tpenqueue and tpdequeue.

    Buffer Type

    Select the type of buffer from the menu. This specifies the type of buffer that the Tuxedo Control supports in the Tuxedo service.

    Possible values are:

    • Carray used when the data is an unspecified array of characters (byte array), any of which can be null. Tuxedo equivalent: CARRAY.
    • FML used when the data contains named fields of simple types each with a maximum length of 65 K bytes.
    • FML32 used when the data contains named fields including nested FML32 fields each having a maximum length of 4 GB.
    • String used when the data contains a simple string as its only contents.
    • View used to define C or COBOL structures for a Tuxedo application and to define an equivalent Java TypedView buffer for a WebLogic application. A view description file in which the fields and types that appear in the data structure are defined, must be available to client and server processes that use a data structure described in a VIEW typed buffer. Encoding and decoding are performed automatically if the buffer is passed between machines of different types.
    • View32 is equivalent to VIEW but uses 32 bits for length and count fields, which allows for larger and more fields.
    • XML used when data is an XML document. Tuxedo equivalent: XML for Tuxedo Release 7.1 and higher.
    • Note: For input XML using data dependent routing, remove all comments generated by the Workshop test browser in the XML buffer. Depending on the location of the comments in the buffer, Tuxedo may have problems parsing the buffer.

    • XCOMMON is a synonym for the view buffer type. An XCOMMON buffer is represented by a Java class extending the TypedXCommon class. It is identical in semantics to a view buffer.

    Buffer Type (cont.)

    • XCTYPE is a synonym for the view buffer type. An XCTYPE buffer is represented by a Java class extending the TypedXCType class. It is identical in semantics to a view buffer.
    • XOCTET is simply a byte array and is a synonym for the CARRAY buffer type in Tuxedo.
    • none used when no input buffer is to be used in the request to the Tuxedo service. If the method signature contains input parameters, an error is generated.

    The default is none.

    Send Queue Space

    If you have selected queue in the Service type field, the Send Queue Space field becomes active. Type the name of the queue space in which the sending queue name is located. This name is the WTC imported service name. This name should match the service name that is mapped in Create a WebLogic Tuxedo Connector (WTC) Service.

    If you are not sure of the name of the queue space, you can click Browse and a list of imported WTC service names display. If the service is listed in the WTC Imported Services dialog, you can select it and click OK. If the service you want is not listed, then the service has not been imported into WebLogic Server.

    To import a service from the WTC Imported Services dialog, click Import and the Services Exported by Tuxedo Application dialog displays.

    For information about importing WTC services, see Import New Tuxedo Services.

    Send Queue Name

    If you have selected queue in the Service type field, the Send Queue Name field becomes active. Type the name of the queue to which messages should be sent.

    Receive Queue Space

    If you have selected a queue in the Service type field, the Receive Queue Space field becomes active. Type the name of the queue space in which the receiving queue name is located.

    If you are not sure of the name of the queue space, you can click Browse and a list of imported WTC service names display. If the service is listed in the WTC Imported Services dialog, you can select it and click OK. If the service you want is not listed, then the service has not been imported into WebLogic Server.

    To import a service from the WTC Imported Services dialog, click Import and the Workstation Address dialog displays.

    For information about importing WTC services, see Import New Tuxedo Services.

    Receive Queue Name

    If you have selected a queue in the Service Type field, the Receive Queue Name field becomes active. Type the name of the queue to receive queued messages.

    Field Tables

    Type the name of the field table for the Tuxedo service when using fml or fml32 buffers. You should specify the field table when using fml or fml32 buffers that are sent or act as reply buffers from the called service. The name of the field table should match the classes generated with the mkfldclass or mkfldclass32 utilities.

    For buffer types fml and fml32, WTC needs the names and types of the fields the buffer can contain. These are described in field table classes created with mkfldclass and mkfldclass32 utilities.

    For more information about mkfldclass and mkfldclass32 utilities, see WebLogic Server Javadoc.

    Return View Classes

    Type the names of the view classes that correspond to the view buffer types that can be received from the Tuxedo service. This field is only required when the Tuxedo service returns a view or view32 buffers. These classes are independent from the Send View Class attribute which is used to specify the view or view32 class that represents the view buffer the Tuxedo service expects as an input.

    Note: The value of this attribute may be a list of classes so that a single Tuxedo service can respond with different VIEW buffers.

    For information about viewj and viewj32 utilities, see WebLogic Server Javadoc.

    Send View Class

    If you have selected view or view32 in the Buffer type field, the Send View Class field becomes active. This attribute provides the name of the class that represents the view/view32 buffer the service is expecting as an input buffer. This view class is used to create the TypedView buffer.

  7. Click Finish. A new control is created and a new icon appears in Design view of the web service.
  8. In Design view, double-click the image of the newly created Tuxedo Control.
  9. The new Tuxedo Control file displays in the Design view.
  10. Click the Source view tab. Edit the signature of this method in the file to match the buffer contents expected for the Tuxedo service being called.
  11. When using the Insert Wizard to create a new Control, a single method is defined that corresponds to the Service Type and Service Name specified in the Insert Wizard. The signature and possibly the name of this method in the control file needs to be edited to match the name and buffer contents expected for the Tuxedo service being called. In addition, any other services that this control calls must have methods defined for them in this interface.

    For queued services, the method name created by the wizard is enqueue, dequeue, or enqueueDequeue. You can change the wizard-created name.

  12. Select File > Save from the menu.
  13. Press Ctrl+w to close the Tuxedo Control file.

Services Using tmqforward

If the queue is being serviced by tmqforward and the service that tmqforward calls generates a reply, a reply-queue-name must be specified for tmqforward from the Property view in the @TuxedoControl.tuxedo annotation. If reply-queue-name is not specified in this situation, the reply is dropped.

Related Topics