Receiving a Message from a JMS Queue

Sybase WorkSpace enables you to receive a message from a specified endpoint 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. 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) > Receive a Message , and click Next.
  4. Select an available JMS provider from 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.

  5. (Optional) If you selected Adaptive Server Enterprise for the connection profile, you must map the messaging provider to the profile.

    Press Create.

  6. Select a Queue.
  7. (Optional) If you select Authentication, provide a valid user name and password for the TIBCO JMS provider.
  8. Click Next to set properties. Skip to step 12 if you have no properties to set.
  9. Click Add to add a selector property.

    Select a property from the available options.

  10. (Optional) Add additional selector properties for the other columns: Operator, Value, or Logical.

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

  11. (Optional) Select the applicable Options.

    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 Resend Message To, select the endpoint to which you want the message re-sent.

  12. (Optional) Select the Return Datatype.
  13. 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
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


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