Implementing Header-based Routing

Enhance the runtime performance when exposing one or more services via JMS, by routing the message without parsing it.

You can route a message by either selecting a JMSAction property entry or a user-defined header property entry. You can only expose one service via this method.

  1. Define a custom wire format (user-defined routing). Create a message definition New > Sybase > Message Definition that defines the message structure including wire format that is used as the service's operation parameter. For example, you could define a message called SimpleMessage that contains two fields that use a comma as the delimiter.
    Note: To route a custom wire formatted message, you must add the message properties defined for the message to the client message, which is described later.
  2. Create a messaging service (for example, outq). Follow the wizard instructions to define the service. Include:
    • Service Endpoint creation – Yes
    • Style – Messaging
    • Endpoint Type – Server

    • Messaging Type – JMS
    • Connection Properties – browse for a valid endpoint in the Enterprise Explorer. Use an existing Message Transport connection cache for the JMS messaging endpoint binding or create a new JMS connection profile.

  3. From the Service editor, select the Service Interface tab and add a one-way operation to the service (for example, send).
  4. Add an operation parameter to the operation:
    1. Highlight the send operation.
    2. Expand the operation parameters list and select Add.
    3. Select Complex Type and Browse to the custom message definition (SimpleMessage) you created earlier as your datatype.

  5. From the Service Binding editor, select the Service Binding tab, click the operation, and select:
    • The Wire Format Properties tab – select the Custom Wire Format checkbox, and select the custom message from the Format drop-down list.

    • The Operation Context tab - change the Content Type to Bytes.
  6. Create the Sybase Services Package Profile. Include the following:
    • Contents - Select the messaging service that you just created (outq) to be included in the package
    • Access Configuration – remove HTTP from the Transports section, and select Custom Wire Format as the Protocol setting.
    Note: You cannot select Custom Wire Format until you remove the HTTP transport from your list of transports (box on the left side).
  7. Associate a name value pair with the operation. This is done from the Access Configuration tab and the Transport sub-tab. You should see the same HeaderName, HeaderValue and HeaderType in the registry definition.
  8. Deploy the service.
  9. Create and deploy a test package that routes the message. (See header-based routing examples below).
  10. Check the service target to ensure the message has been routed.

Header-based Routing Examples

Keep the following in mind when using header-based routing:


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.