Inbound messaging

To route a REST API calls through JMS with the use of either the broker's protocol or the AMQP protocol, add and configure the Inbound messaging policy in IBM API Studio.

The Inbound messaging policy enables communication through the messaging queue or topic.

Java Message Service (JMS) is a standard Java API for communicating with message-oriented middleware and enables loosely coupled communication between two or more homogeneous systems. It is a reliable and asynchronous form of communication.

Advanced Message Queuing Protocol (AMQP) is an open standard application layer protocol for delivering messages. AMQP can queue and route messages in a reliable and secured way. It provides a standard messaging protocol that spans across all platforms and outlines how to construct a message. It doesn't provide an API on how the message must be sent. AMQP being language neutral is useful in the message-oriented middleware to achieve interoperability in asynchronous way among heterogeneous systems.

You can use this policy to route your API through JMS/AMQP to enable your client to communicate through the messaging queue or topic.
  • JMS with Message broker native protocol support. For example, if your Message broker is ActiveMQ and you use its default ActiveMQ TCP protocol, you're essentially using JMS on OpenWire, as OpenWire is ActiveMQ's native protocol.
  • JMS with AMQP protocol support. For example, you can use JMS with AMQP with any message broker that supports AMQP 1.0 to achieve interoperability in an asynchronous way among heterogeneous systems. IBM API Studio supports AMQP 1.0 using Apache qpid JMS client.

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

Example of an Inbound Messaging policy in code view.
kind: InboundMessaging
apiVersion: api.ibm.com\v1
metadata:
  name: JMSAMQPTransport
  version: 1
  namespace: sample
spec:
  alias: sample
  source:
    - name: sourceName
      type: QUEUE #QUEUE or TOPIC
      selector:
        - sample
      resource: '/auth/create'
      httpMethod: GET # One among GET, POST, PUT or DELETE
      contentType: content

For the InboundMessaging policy kind, configure these specifications:

Property Description
spec
  • alias. Specifies the alias name for the configuration.
  • source. Title to denote the section that configures the JMS / AMQP source details.
    • name. Specifies the name of the JMS / AMQP source.
    • type. Specifies the JMS / AMQP message source type. The type can either be a QUEUE or a TOPIC.
    • selector. Specifies the filtering rule for selecting messages.
    • resource. Specifies the file path to the resource used for processing the message.
    • httpMethod. Defines the HTTP method for interacting with the resource. This field is optional.
      • Use the field to configure one of these HTTP methods:
      • GET
      • POST
      • PUT
      • DELETE
    • contentType. Specifies the content type that is expected in the message. This field is optional. As this property supports a variable framework, you can use the available variables to specify the content type and accept header.