Sending a Message to a JMS Queue

This real-time data function sends a message, which can be defined in a stored procedure or trigger, to a specified endpoint in a JMS queue. To send a message to a JMS queue, you must have TIBCO JMS running and an Adaptive Server Enterprise connection profile with Real-Time Messaging configured. A message receiver/queue must be available in the TIBCO JMS server to serve as the endpoint, or destination, for the sent message.

To send a message to a JMS Queue:

  1. From Database Explorer under the ASE connection profile, expand the Procedures and Functions folder or, for triggers, expand the Tables folder and expand the table, then the Triggers folder.

  2. Select the procedure to which you want to add messaging syntax. Right-click and select Edit Procedure. Alternatively, select the trigger to which you want to add messaging syntax. Right-click and select Edit Trigger.

    The procedure or trigger code appears in SQL Editor.

  3. Place the cursor in the desired location in the code, right-click and select Real-time Messaging Wizard. You can also open the Messaging wizard from the ASE Real-Time Messaging Wizard icon on the toolbar. The Select a Wizard dialog appears. Select the Send a Message function; if not already visible, expand the Real-time Data Functions|Queue-Related Functions folders first.

  4. Select Send a Message and click Next. The Specify Endpoint dialog appears.

  5. Select an available JMS provider using the drop-down in the JMS Connection Profile field.

    The Provider Class and Provider URL fields are filled in automatically.

  6. Select a queue from the Queue list.

    Note

    For a queue to be listed, it must exist in the TIBCO JMS server. See your TIBCO JMS documentation for information on creating queues.

  7. (Optional) When Authentication is selected, provide a user name and password that are configured on the TIBCO JMS provider (see Enabling ASE Real-Time Messaging Services).

  8. The Preview box displays the existing SQL constructs. Click Next. The Specify Message Body page appears.

  9. In the Specify Message Body dialog, select one of the following:

    OptionAction
    VariableProvides a local variable or parameter form before the current cursor position. Choose the variable or parameter from the drop-down. The chosen variable or parameter becomes the message body in the current stored procedural object definition.
    TextEnter the message text, or use the Browse feature to locate a text file for the message body.
    ByteEnter the message body in hexadecimal format. You can also use the Browse button to locate a hexadecimal file that you can copy into the message body.
    Select StatementWhen you choose this option, the SQL button just below the Browse button is enabled. Select SQL... to invoke the Visual SQL dialog.
  10. (Optional) Click Next. The Specify Message Options dialog appears.

  11. Choose among the three tabs:

    TabDescription
    Options Contains the default JMS options:
    • Type: Select Text or Bytes as the message type.

    • Schema: Choose Use User-Defined Schema to activate the User-Defined Schema frame. Use the Browse feature to locate the XML schema file.

    PropertiesThe options in this dialog allow you to customize JMS system properties: mode, priority, correlation, reply queue, reply topic, and time-to-live. Sybase provides default values. To change these, use the drop-downs and check boxes where provided. The Correlation field remains dimmed unless you select its check box.
    User-Defined PropertiesClick Add to invoke the Property dialog. Enter the name and value of the property you want to add. Select the String Type check box if required. Click OK. The property name and value appears in the User Defined Properties table.
  12. Click Finish. The messaging constructs are entered into SQL Editor.

    Note

    Because ASE messaging constructs are functions, select appears before the messaging construct. You can also assign the messaging function to a local variable that has already been declared.

Enabling ASE Real-Time Messaging Services

Creating a JMS Connection Profile

Receiving a Message from a JMS Queue

Real-Time Messaging Services

See the Adaptive Server Enterprise Messaging Services User's Guide for Real-Time Data Services.

Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com