Contact Us 1-800-596-4880

Supported Bindings and Parametrized Channels in APIkit for AsyncAPI

APIkit for AsyncAPI supports various bindings to enable message-driven architectures, and parametrized channels to define dynamic and reusable configurations.

Supported Bindings

Anypoint Connector for MQ (Anypoint MQ Connector)

Binding Publish Message Listener Description Reference

Destination

Destination

Destination

Destination (queue or exchange) name for this channel. It’s optional and defaults to the channel name. Specify it if the channel name differs from the actual destination name. For example, if the channel name isn’t a valid destination name in Anypoint MQ.

DestinationType

DestinationType

DestinationType

Type of destination (queue or exchange, or FIFO queue). It’s optional and defaults to queue. Specifies the messaging model supported by this channel:

  • Publish/subscribe

  • Point-to-point

  • Strict message ordering

Kafka Connector

Binding Publish Message Listener Description Reference

Key

Key

Key

Key associated with the message in this channel. It’s optional and defaults to no key. Specifies if the message requires a specific key for partitioning or message grouping.

Solace PubSub+ Connector

Binding Publish Message Listener Description Reference

deliveryMode

deliveryMode

deliveryMode

Solace PubSub+ Connector operates in direct or persistent mode. The default mode is persistent. The deliveryMode parameter determines the quality of service for publishing messages. The Direct mode offers lower latency but doesn’t guarantee message delivery. The persistent mode ensures that messages are reliably delivered, even in the event of a broker failure.

destinationType

destinationType

destinationType

Solace PubSub+ Connector supports queue in APIkit for AsyncAPI.

topicSubscriptions

N/A

topicSubscriptions

Solace PubSub+ Connector specifies the list of topics the queue subscribes to when the destinationType is queue. If you specify no topic, the queue automatically subscribes to the topic the channel name represents.

Anypoint Connector for Apache Kafka (Apache Kafka Connector) and Solace PubSub+ Connector don’t support bindings.

Parameterized Channels

APIkit for AsyncAPI supports parametrized channels so you can define dynamic and reusable configurations, scale your integrations more effectively, and create consistent configurations across different parts of the integration.

APIkit for AsyncAPI doesn’t support parameters if they’re defined in a binding. For example, a destination in AnypointMQ.

This code provides a partial API spec example with a parameterized destination:

channels:
  orderAcknowledgement:
    description: new Order Acknowledgment
    servers:
      - anypointMQ
    bindings:
      anypointmq:
        destination: '{env}.amq-asyncapi-poc.orderAcknowledgement'
        destinationType: queue
    parameters:
      env:
        $ref: '#/components/parameters/env'
    publish:
      operationId: listen-order-ack
      description: publish a new Order Acknowledgment event to this channel and we will process it
      message:
        $ref: '#/components/messages/orderAckMessage'

You must set the parametrized channel at design time. You can’t set the parametrized channel at runtime.

See the complete API example using parametrized channels:

asyncapi: '2.6.0'
info:
  title: AMQ-AsyncAPI-PoC
  version: '1.0.11'
  description: Proof of Concept for Anypoint MQ AsyncAPI interface
  contact:
    name: Example Company
    email: address@example.com
tags:
  - name: WMS
    description: Warehouse Management System
  - name: PoC
    description: Proof of Concept
  - name: Order Acknowledgement

servers:
  anypointMQ:
    url: https://{region}.anypoint.mulesoft.com/api/{version}/organizations/{organizationId}/environments/{environmentId}
    protocol: anypointmq
    protocolVersion: v1
    description: The Anypoint MQ broker
    variables:
      region:
        $ref: '#/components/serverVariables/region'
      version:
        $ref: '#/components/serverVariables/version'
      organizationId:
        $ref: '#/components/serverVariables/organizationId'
      environmentId:
        $ref: '#/components/serverVariables/environmentId'

channels:
  orderAcknowledgement:
    description: new Order Acknowledgment
    servers:
      - anypointMQ
    bindings:
      anypointmq:
        destination: '{env}.amq-asyncapi-poc.orderAcknowledgement'
        destinationType: queue
    parameters:
      env:
        $ref: '#/components/parameters/env'
    publish:
      operationId: listen-order-ack
      description: publish a new Order Acknowledgment event to this channel and we will process it
      message:
        $ref: '#/components/messages/orderAckMessage'

components:
  parameters:
    env:
      description: The Mule runtime environment
      schema:
        type: string
        enum:
          - dev
          - tst
          - acc
          - prd
        default: tst
  serverVariables:
    region:
      description: the CloudHub region where the endpoint is situated
      enum:
        - mq-eu-west-1
      default: mq-eu-west-1
    version:
      description: the version of the Anypoint MQ API
      enum:
        - v1
      default: v1
    organizationId:
      description: the identifier of our organization (business group)
      enum:
        - 7a2b1c3d-4e5f-6g7h-8i9j-0k1l2m3n4o5p
    environmentId:
      description: the identifier of the runtime environment within the organization
      enum:
        - a1b2c3d4-5e6f-7g8h-9i0j-1k2l3m4n5o6p
        - b2c3d4e5-6f7g-8h9i-0j1k-2l3m4n5o6p
        - c3d4e5f6-7g8h-9i0j-1k2l-3m4n5o6p
      default: a1b2c3d4-5e6f-7g8h-9i0j-1k2l3m4n5o6p
  messages:
    orderAckMessage:
      name: OrderAckMessage
      description: an order acknowledgment message.
      payload:
        $ref: 'schemas/orderAcknowledgement.json'
APIkit for AsyncAPI uses the parametrized channels only on listeners.