Receiving a Message from a JMS Queue

Sybase WorkSpace enables you to receive a message from a specified end point in a JMS queue. This message can be defined in a stored procedure or trigger.

Prerequisites 

To receive a message from a JMS queue, you must have TIBCO JMS running and an open Adaptive Server Enterprise connection profile with Real-Time Messaging configured. A message receiver/queue must be available in the JMS server to serve as the endpoint, or destination, for the received message.

  1. From Enterprise Explorer, find the ASE connection profile.
  2. Select the procedural object for which you want to add messaging syntax.
    Procedural Object How to select
    Stored procedure Expand the Stored Procedures folder, right-click the procedure, and select Edit.
    Trigger Expand the Tables folder, expand the table, and then the Triggers folder. Right-click the trigger and select Edit.

    The procedure or trigger code appears in its associated editor.

  3. 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 the icon on the toolbar.

  4. Select Queue-related Functions (TIBCO JMS) > Receive a Message, and click Next.
  5. Select an available JMS provider using the drop-down in the JMS Connection Profile field.

    If you select an existing JMS connection profile, skip to step 7. If you select an Adaptive Server Enterprise, you must map the messaging provider to the profile. Go to the next step.

    Once a profile is chosen, the Provider Class and Provider URL fields are filled in automatically.

  6. (Optional) If you selected Adaptive Server Enterprise for the connection profile, you must map the messaging provider to the profile.
    1. Press Create to invoke the New JMS Connection Profile wizard.
  7. Select a Queue.
  8. (Optional) When the Authentication check box is selected, provide a user name and password that are configured on the TIBCO JMS provider.

    The Preview box displays the existing SQL constructs. The Receive a Message from a Queue page appears.

  9. Click Next to set properties. Skip to step 12 if you have no properties to set.
  10. Click Add to add a selector property.

    Select a property from the available options.

  11. (Optional) Perform the same action in step 10 for the other columns: Operator, Value, and Logical.

    Select the appropriate element from the drop-down from each column for each row that you are declaring a property.

  12. (Optional) In the Options box, select the applicable check boxes: In the Timeout field, choose the number of days, hours, minutes, and seconds you want the message to remain in the queue.

    Use the arrow keys to incrementally change the numbers. If you selected the Resend Message To check box, select from the drop-down at the right of its field the endpoint to which you want the message resent.

  13. (Optional) Select the Return Datatype.
  14. Click Finish.

    The messaging constructs appear in the Editor view.

    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
Sending a Message to 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

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.