Subscribing to a Topic

This real-time data function allows messaging constructs to receive messages from a published topic to which it subscribes in a JMS queue. Unlike sending and receiving a message, any authorized user can subscribe to a topic that has been published. For a messaging construct to subscribe to a topic from a JMS queue, you must have both TIBCO JMS and Adaptive Server Enterprise connection profiles running with Real Time Messaging configured. A topic must be available in the TIBCO JMS server to serve as an endpoint, or destination, for the subscription.

To subscribe to a topic in a JMS queue:

  1. From Database Explorer under the ASE connection profile, expand the Procedures and Functions folder or, for triggers, expand the Tables folder and expand the table, then the Triggers folder.

  2. Select the procedure or trigger to which you want to add messaging syntax. 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 the Subscribe to a Topic function is not visible, expand the Real-time Data Functions|Topic-Related Functions folders first.

  4. Select Subscribe to a Topic and click Next.

    The Specify Subscription dialog appears.

  5. In Subscription Name, choose a subscription name. Read-only information about the subscription appears in the Subscription Information box.

    SQL code to be generated by the subscription appears in the Preview box.

  6. Click Finish. The messaging constructs appear in SQL Editor.

    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

Registering a Subscription

Creating an ASE Connection Profile

Creating a JMS Connection Profile

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