Subscribing to a Topic

Sybase WorkSpace 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.

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

  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 Procedures and Functions folder, right-click the procedure, and select Edit Procedure.
    Trigger Expand the Tables folder, expand the table, and then the Triggers folder. Right-click the trigger and select Edit Trigger.

    The procedure or trigger code appears in the Procedural Object Editor.

  3. Place the cursor in the desired location within the SQL code, right-click and select Real-Time Messaging Wizard.

    The Select a Wizard dialog appears. If the Subscribe to a Topic function is not visible, expand the Real-time Data Functions > Topic-related Functionsfolders 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.
    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.

    The messaging constructs appear in the Procedural Object Editor.

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