Consuming a Message from a Topic

This real-time messaging function allows messaging contructs subscribing to a topic to receive messages broadcast from that topic. Publishing/consuming a message follows a one-to-many model rather than a one-to-one model. To consume a message from a topic, you must have TIBCO JMS and Adaptive Server Enterprise connection profiles running with Real-Time Messaging configured. A subscription to an existing topic must be available in a JMS server.

  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 Topic-Related Functions > Consume a Message, and click Next.
  4. Select a Subscription Name associated with the topic from which you want your messaging construct to consume a message.
  5. (Optional) Select the applicable Options.

    In the Timeout field, choose the number of days, hours, minutes, and seconds you want the message consumer to be blocked for the message. If you selected Resend Message To, select the topic to which you want the message forwarded.

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

For more information, see the Adaptive Server Enterprise Messaging Services User's Guide for Real-Time Data Services.

Related concepts
Real-Time Messaging Services
Mapping Functions
Related tasks
Sending a Message to a JMS Queue
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
Unsubscribing from a Topic
Registering a Subscription
Parsing an XML Document
Retrieving XML Message Properties
Related reference
Select for XML Statements

For product-related issues, contact Sybase Technical Support at 1-800-8SYBASE. Send your feedback on this help topic directly to Sybase Technical Publications: pubs@sybase.com