Sending a Message to a JMS Queue

Sybase WorkSpace enables you to send a message to a specified endpoint in a JMS queue. This message can be defined in a stored procedure or trigger.

Prerequisites 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.
  1. For the appropriate ASE connection profile and database, select the appropriate procedural object.
    Object How to select
    Stored procedure Expand the Stored Procedures folder, right-click the stored procedure, and select Edit.
    Trigger Expand the Tables folder, expand the table, and then expand the Triggers folder. Right-click the trigger and select Edit.
  2. In the Source page, place the cursor in the desired location within the SQL code, right-click and select Sybase_ASE_15.x > Real-Time Messaging Wizard .

    You can also open the wizard from theReal-Time Messaging Wizard icon ASE Real-Time Messaging Wizard icon on the toolbar.

  3. Select Queue-Related Functions (TIBCO JMS) > Send a Message , and click Next.
  4. Select a JMS connection profile and ASE JMS provider from the corresponding drop-down menus.

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

  5. Select a Queue.
    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.
  6. (Optional) When Authentication is selected, provide a user name and password that are configured on the TIBCO JMS provider.

    The Preview box displays the existing SQL constructs.

  7. Click Next.
  8. In the Specify Message Body dialog, select one of the following:
    Option Action
    Variable Select a local variable or parameter before the current cursor position. The selected variable or parameter becomes the message body in the current stored procedural object definition.
    Text Enter the message text, or use Browse to locate a text file for the message body.
    Bytes Enter the message body in hexadecimal format. You can also use Browse to locate a hexadecimal file that you can copy into the message body.
    Select Statement Select SQL... to invoke the Visual SQL dialog.
  9. Click Next to specify message options.
    Tab Description
    Options Contains the default JMS options:
    • Message Type – select Text or Bytes.

    • Message Schema – use User-Defined Schema to activate the User-Defined Schema frame. Use Browse to locate the XML schema file.

    Properties Customize JMS system properties: mode, priority, correlation, reply queue, reply topic, and time-to-live. Sybase provides default values that you can change. The Correlation field remains dimmed unless you select it.
    User-Defined Properties
    1. Click Add.
    2. Enter the name and value of the property you want to add.
    3. (Optional) Select String Type.
    4. Click OK.
  10. Click Finish.
    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.
Related concepts
Real-Time Messaging Services
Mapping Functions
Related tasks
Receiving a Message from a JMS Queue
Sending a Message to a WebSphere MQ Queue
Receiving a Message from a WebSphere MQ Queue
Publishing a Message to a Topic
Subscribing to a Topic
Consuming a Message from a Topic
Unsubscribing from a Topic
Registering a Subscription
Parsing an XML Document
Retrieving XML Message Properties
Related reference
Select for XML Statements


Created June 25, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com