This real-time data function sends a message, which can be defined in a stored procedure or trigger, to a specified endpoint in a JMS queue. To send a message to a JMS queue, you must have TIBCO JMS running and an Adaptive Server Enterprise connection profile with Real-Time Messaging configured. A message receiver/queue must be available in the TIBCO JMS server to serve as the endpoint, or destination, for the sent message.
To send a message to a JMS Queue:
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.
Select the procedure to which you want to add messaging syntax. Right-click and select Edit Procedure. Alternatively, select the trigger to which you want to add messaging syntax. Right-click and select Edit Trigger.
The procedure or trigger code appears in SQL Editor.
Place the cursor in the desired location in the code, right-click and select Real-time Messaging
Wizard. You can also open the Messaging wizard from the
icon on the toolbar. The Select a Wizard dialog appears. Select the Send a Message function; if not already visible, expand the Real-time Data
Functions|Queue-Related Functions folders first.
Select Send a Message and click Next. The Specify Endpoint dialog appears.
Select an available JMS provider using the drop-down in the JMS Connection Profile field.
The Provider Class and Provider URL fields are filled in automatically.
Select a queue from the Queue list.
For a queue to be listed, it must exist in the TIBCO JMS server. See your TIBCO JMS documentation for information on creating queues.
(Optional) When Authentication is selected, provide a user name and password that are configured on the TIBCO JMS provider (see Enabling ASE Real-Time Messaging Services).
The Preview box displays the existing SQL constructs. Click Next. The Specify Message Body page appears.
In the Specify Message Body dialog, select one of the following:
Option | Action |
---|---|
Variable | Provides a local variable or parameter form before the current cursor position. Choose the variable or parameter from the drop-down. The chosen variable or parameter becomes the message body in the current stored procedural object definition. |
Text | Enter the message text, or use the Browse feature to locate a text file for the message body. |
Byte | Enter the message body in hexadecimal format. You can also use the Browse button to locate a hexadecimal file that you can copy into the message body. |
Select Statement | When you choose this option, the SQL button just below the Browse button is enabled. Select SQL... to invoke the Visual SQL dialog. |
(Optional) Click Next. The Specify Message Options dialog appears.
Choose among the three tabs:
Tab | Description |
---|---|
Options | Contains the default JMS options:
|
Properties | The options in this dialog allow you to customize JMS system properties: mode, priority, correlation, reply queue, reply topic, and time-to-live. Sybase provides default values. To change these, use the drop-downs and check boxes where provided. The Correlation field remains dimmed unless you select its check box. |
User-Defined Properties | Click Add to invoke the Property dialog. Enter the name and value of the property you want to add. Select the String Type check box if required. Click OK. The property name and value appears in the User Defined Properties table. |
Click Finish. The messaging constructs are entered into SQL Editor.
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.
Enabling ASE Real-Time Messaging Services
Creating a JMS Connection Profile
Receiving a Message from a JMS Queue
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