AsyncApi 和 RabbitMq

AsyncApi and RabbitMq

如何将我的 RabbitMq 交换放入 asyncapi 定义?

在示例中我发现了这个...

channels:
  user/signup:
    publish:
      bindings:
        amqp:
          expiration: 100000
          userId: guest
          cc: ['user.logs']
          priority: 10
          deliveryMode: 2
          mandatory: false
          bcc: ['external.audit']
          replyTo: user.signedup
          timestamp: true
          ack: false
          bindingVersion: 0.2.0

频道名称中斜线前的部分是不是交换的意思?

有一个完整的 exchange 属性 可以用于 channel binding for AMQP. The binding you are currently using is the operation binding

这意味着你可以这样定义它

channels:
  user/signedup:
    publish:
      bindings:
        amqp:
          expiration: 100000
          userId: guest
          cc: ['user.logs']
          priority: 10
          deliveryMode: 2
          mandatory: false
          bcc: ['external.audit']
          replyTo: user.signedup
          timestamp: true
          ack: false
          bindingVersion: 0.2.0
    bindings:
      amqp:
        is: routingKey
        queue:
          name: my-queue-name
          durable: true
          exclusive: true
          autoDelete: false
          vhost: /
        exchange:
          name: myExchange
          type: topic
          durable: true
          autoDelete: false
          vhost: /
        bindingVersion: 0.2.0