Sending a Message to a WebSphere MQ Queue

Sybase WorkSpace enables you to send a message to a specified end point in a WebSphere MQ queue. This message can be defined in a stored procedure or trigger.

Prerequisites 

To send a message to an WebSphere MQ queue, you must have IBM WebSphere MQ running and an Adaptive Server Enterprise connection profile with Real-Time Messaging configured. A message receiver/queue must be available in the WebSphere MQ server to serve as the endpoint, or destination, for the sent message.

  1. From Enterprise Explorer, find the ASE connection profile.
  2. Select the procedural object or trigger 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 the corresponding object editor.

  3. In the Source page, place the cursor in the desired location within the SQL code, right-click and select Sybase_ASE_15.x > Real-time Messaging Wizard .

    You can also open the wizard from the icon on the toolbar.

  4. Select Queue-related Functions (MQSeries) > Send a Message, and click Next.
  5. Specify an ASE JMS provider, and provide endpoint information.
    Field Description
    Host Name Endpoint host name
    Port Endpoint port number
    Queue Manager Endpoint queue manager
    Remote Queue Manager Remote manager
    Client Channel Endpoint client channel
    Queue Endpoint queue
  6. Click Next.
  7. In the Specify Message Body dialog, select one of the following:
    Option Action
    Variable Provides a local variable or parameter 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.
    Bytes 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.
  8. (Optional) Click Next to specify message options.
  9. Enter the message options.
    Tab Description
    Options Contains the default options:
    • msgtype: Select datagram, request, reply, or report as the message type. The default is datagram.

    • rfhCommand: Select null, deletePublication, deregisterPublisher, deregisterSubscriber, publish, registerPublisher, registerSubscriber, or requestUpdate.

    Properties Customize messaging system properties. Sybase provides default values. To change these, use the drop-downs and check boxes where provided. Use Delete and Delete All to remove items from this list.
    Header Properties To add a property, click in the Types field, and choose a type from the drop-down menu. Specify a value in the Values field. Use Delete and Delete All to remove properties from this dialog.
  10. 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.
Related concepts
Real-Time Messaging Services
Mapping Functions
Related tasks
Sending a Message to a JMS Queue
Receiving a Message from a JMS Queue
Receiving a Message from a WebSphere MQ Queue
Publishing a Message to a Topic
Subscribing 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.