0

如何将我的 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

斜线之前的频道名称部分可能是交换的意思吗?

4

1 回答 1

1

您可以将整个exchange属性用于 AMQP的通道绑定。您当前使用的绑定是操作绑定

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

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
于 2021-06-11T19:02:16.037 回答