Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix incorrect example for AMQP #233

Merged
merged 2 commits into from
Feb 12, 2024

Conversation

jonaslagoni
Copy link
Member

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.

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
Copy link
Member

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

@jonaslagoni
Copy link
Member Author

jonaslagoni commented Jan 13, 2024

@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 🙂

Copy link
Collaborator

@GreenRover GreenRover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I not 100% familiar with amqp but the change makes sense for me.

@jonaslagoni
Copy link
Member Author

Thanks for the review @GreenRover ✌️

@jonaslagoni
Copy link
Member Author

/rtm

@asyncapi-bot asyncapi-bot merged commit 06c8faf into asyncapi:master Feb 12, 2024
6 checks passed
@jonaslagoni jonaslagoni deleted the patch-1 branch February 12, 2024 11:59
@g-radam
Copy link

g-radam commented May 21, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants