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.

To consume a message from a topic:

  1. In Database Explorer under the ASE Connection profile, expand the Procedures and Functions folder; or for triggers, expand the Tables folder, then the appropriate table, and finally the Triggers folder.

  2. Select the procedure or trigger that you want to consume messages from a topic. Right-click and select Edit Procedure or Edit Trigger. The procedure or trigger code appears in SQL Editor.

  3. Place the cursor in the desired location within the SQL code, right-click and select Real-time Messaging Wizard. You can also open the wizard from the ASE Real-Time Messaging Wizard icon on the toolbar.

    The Select a Wizard dialog appears. If Consume a Message is not visible, expand the Real-time Data Functions|Topic-related Functions folders.

  4. Select Consume a Message and click Next.

    The Consume a Message from a Topic dialog appears.

  5. In Subscription Name, select the subscription name associated with the topic from which you want your messaging construct to consume a message.

    Database Development automatically populates the read-only fields in the Subscription Information box.

  6. (Optional) In the Options box, select the appropriate check boxes: In the Timeout field, choose the number of days, hours, minutes, and seconds you want the message consumer to be blocked for the message. Use the arrow keys to change the numbers. If you selected Resend Message To, select the topic to which you want the message forwarded.

  7. (Optional) In Return Datatype, select the datatype in which you want the message received. The read-only Preview box automatically displays the SQL code generated by your actions.

  8. 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.

Publishing a Message to a Topic

Creating an ASE Connection Profile

Creating a JMS Connection Profile

Registering a Subscription

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