JMS/AMQP REST routing

This policy routes REST requests to JMS or AMQP destinations.

The configuration defines how REST requests are routed to JMS or AMQP messaging systems. It includes connection details, destination settings, reply handling behavior, message lifetime settings, and any custom properties required for message delivery or processing.

In IBM API Studio, this policy is identified by the kind Route.

Example of a JMS/AMQP REST routing policy:

kind: Route
apiVersion: api.ibm.com/v2
metadata:
  name: jmsamqp-routing
  version: 1.0
  namespace: wm_project
spec:
  messageConfig:
    $ref: wm_project:MessageConfig:1.0

---
kind: MessageConfig
apiVersion: api.ibm.com/v2
metadata:
  name: MessageConfig
  version: 1.0
  namespace: wm_project
spec: 
  connectionAlias: DEFAULT_IS_JMS_CONNECTION
  destination:
    name: destination
    type: queue # queue or topic
  replyTo:
    name: replyto
    type: topic # queue or topic
  ttl: 10ms
  timeToWait: 10ms
  deliveryMode: non_persistent # persistent or non_persistent
  property:
    - key: ${request.path}
      value: test-value

To invoke the JMS/AMQP REST routing policy, you can specify:

Type Description
spec

References the message configuration to use for JMS/AMQP REST routing.

The value is provided as a $ref in the format namespace:messageConfig_name:version. This referenced configuration defines settings such as connection information, destination details, reply handling, message lifetime, and any custom properties required for message processing.

To configure the messageConfig, you can specify:

Type Description
spec
  • connectionAlias. Specify the alias name of the messaging connection to use for sending messages.
  • destination. Define where the message should be sent.

    Configure the following specifications:
    • name. Specify the destination name.
    • type. Specify the type. The type can either be a queue or a topic.
  • replyTo. Define where any reply message should be sent.

    Configure the following specifications:
    • name. Specify the name.
    • type. Specify the type. The type can either be a queue or a topic.
  • ttl. Set how long the message stays valid before it is discarded. Enter the value in milliseconds.
  • timeToWait. Set how long to wait for a reply or confirmation. Enter the value in milliseconds.
  • deliveryMode. Choose whether the message should be saved or sent without saving. Select either persistent mode or non_persistent mode.
  • property. Add custom message properties.

    Configure the following specifications:
    • key. Specify the name of the message field to include.
    • value. Specify the value for the message field.