asyncapi / bindings

AsyncAPI bindings specifications
Apache License 2.0
71 stars 75 forks source link

docs: fix incorrect example for AMQP #233

Closed jonaslagoni closed 7 months ago

jonaslagoni commented 8 months ago

According to the JSON Schema files, you are only allowed to use exchange or queue depending on the is: https://github.com/asyncapi/spec-json-schemas/blob/287ed2846a764ac6ffce1d5034a9e3e47853a247/bindings/amqp/0.3.0/channel.json#L84

You cannot have both, which makes the example invalid.

Tenischev commented 8 months ago

@jonaslagoni actually, having both makes sense and I would say that the description is wrong, not the example

jonaslagoni commented 8 months ago

@Tenischev might be, I have no idea 😄 I would definitely do a new issue discussing this.

This PR just fixes the example based on the current version of AMQP and whats valid 🙂

jonaslagoni commented 7 months ago

Thanks for the review @GreenRover ✌️

jonaslagoni commented 7 months ago

/rtm

g-radam commented 4 months ago

Is someone able to elaborate how you would declare an AMQP channel queue binding, where that queue is bound to an exchange (in the RabbitMQ sense)? See: RabbitMQ Queue Binding.

I interpreted the original example:

channels:
  userSignup:
    address: 'user/signup'
    bindings:
      amqp:
        is: queue
        queue:
          name: my-queue-name
          durable: true
          exclusive: true
          autoDelete: false
          vhost: /
        exchange:
          name: my-service-exchange
        bindingVersion: 0.3.0

to mean the channel declares a queue called "user/signup" which operations will use, and that queue was bound to an exchange of my choice (IE receive messages from that exchange). Unless my interpretation of this is wrong, how else would you declare that the channel queue is bound to a custom exchange??

I would have said the amqp schema is wrong, not the example. Am I missing something here?