APIkit for AsyncAPI でサポートされているバインドとパラメーター化されたチャネル

APIkit for AsyncAPI は、メッセージ駆動型アーキテクチャを可能にするさまざまなバインドをサポートしています。

コネクタ パブリッシュ メッセージリスナー 説明 参照

MQ (Anypoint MQ Connector) 用 Anypoint コネクタ

destination

destination

デフォルトでは、AnypointMQ Connector は ​destination​ としてチャネル名を使用します。チャネル名が実際の ​destination​ 名と異なる場合、またはチャネル名が有効な ​destination​ 名でない場合は、​destination​ (キューまたはエクスチェンジ) 名を指定する必要があります。

「Anypoint MQ Bindings (Anypoint MQ バインド)」​を参照してください。

Solace PubSub+ Connector

deliveryMode

deliveryMode

Solace PubSub+ Connector は、​direct​ モードまたは ​persistent​ モードで動作します。デフォルトモードは ​persistent​ です。​deliveryMode​ パラメーターは、メッセージのパブリッシュのサービス品質を決定します。​Direct​ モードは、レイテンシーは低くなりますが、メッセージ配信が保証されません。「persistent」モードでは、ブローカーに障害が発生した場合でも、メッセージが確実に配信されます。

「Solace Bindings (Solace バインド)」​を参照してください。

destinationType

destinationType

Solace PubSub+ Connector は、APIkit for AsyncAPI の ​queue​ をサポートしています。

「Solace Bindings (Solace バインド)」​を参照してください。

なし

topicSubscriptions

Solace PubSub+ Connector は、​destinationType​ が ​queue​ の場合にキューがサブスクライブするトピックのリストを指定します。トピックを指定しない場合、​queue​ はチャネル名が表すトピックに自動的にサブスクライブします。

「Solace Bindings (Solace バインド)」​を参照してください。

Apache Kafka 用 Anypoint Connector (Apache Kafka Connector) および Solace PubSub+ Connector は、バインドをサポートしていません。

パラメーター化されたチャネル

APIkit for AsyncAPI はパラメーター化されたチャネルをサポートしているため、動的で再利用可能な設定を定義し、インテグレーションをより効果的に拡張し、インテグレーションのさまざまな部分で一貫した設定を作成できます。

APIkit for AsyncAPI は、バインドで定義されたパラメーターをサポートしていません。たとえば、AnypointMQ の ​destination​ など。

次のコードは、パラメーター化された ​destination​ を含む部分的な API 仕様の例を示しています。

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'

パラメーター化されたチャネルは、設計時に設定する必要があります。実行時にパラメーター化されたチャネルを設定することはできません。

パラメーター化されたチャネルを使用した完全な API の例を示します。

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 は、​listeners​ でのみパラメーター化されたチャネルを使用します。