Sybase WorkSpace enables you to receive a message from a specified
end point in a JMS queue. This message can be defined in a stored procedure or
trigger.
PrerequisitesÂ
To receive a message from a JMS queue, you must have TIBCO JMS running
and an open Adaptive Server Enterprise connection profile with Real-Time
Messaging configured. A message receiver/queue must be available in the JMS
server to serve as the endpoint, or destination, for the received message.
- From
Enterprise Explorer, find the ASE connection
profile.
- Select the
procedural object for which you want to add messaging syntax.
Procedural Object |
How to
select |
Stored procedure |
Expand the
Stored Procedures folder, right-click the procedure, and select
Edit.
|
Trigger |
Expand the
Tables folder, expand
the table, and then the
Triggers folder.
Right-click the trigger and select
Edit. |
The procedure or trigger code appears in its associated editor.
-
In the Source page, place the cursor in the desired location within the SQL code, right-click and select
.
You can also open the wizard from the
icon on the toolbar.
-
Select
, and click
Next.
-
Select an available JMS provider using the drop-down in the
JMS Connection Profile
field.
If you select an existing JMS connection profile, skip to step 7.
If
you select an Adaptive Server Enterprise, you must map the messaging provider
to the profile. Go to the next step.
Once a profile is chosen, the Provider Class and Provider URL
fields are filled in automatically.
- (Optional) If you
selected
Adaptive Server Enterprise for the connection
profile, you must map the messaging provider to the profile.
- Press
Create to invoke the New JMS Connection
Profile wizard.
-
Select a
Queue.
-
(Optional) When the
Authentication check box
is selected, provide a user name and password that are configured on the TIBCO
JMS provider.
The Preview box displays the existing SQL constructs. The
Receive a Message from a Queue page appears.
-
Click
Next to set properties.
Skip to step 12 if
you have no properties to set.
-
Click Add to add a selector property.
Select a property from the available options.
-
(Optional) Perform the same action in step 10
for
the other columns:
Operator,
Value, and
Logical.
Select the appropriate element from the drop-down from each column
for each row that you are declaring a property.
-
(Optional) In the
Options box, select the applicable check
boxes: In the
Timeout field, choose the
number of days, hours, minutes, and seconds you want the message to remain in
the queue.
Use the arrow keys to incrementally change the numbers. If you
selected the Resend Message To check box, select from the drop-down at the
right of its field the endpoint to which you want the message resent.
-
(Optional) Select the
Return Datatype.
-
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.