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

Given a channel name, how do you know which broker (server) should be used? #255

Closed
treeder opened this issue Aug 8, 2019 · 8 comments
Closed
Labels
keep-open Prevents stale bot from closing this issue or PR

Comments

@treeder
Copy link

treeder commented Aug 8, 2019

Some things to consider:

  • Multiple servers could have the same channel name - I subscribe to "orders" channel on server A and publish to "orders" on server B
  • The websocket example from Create WebSocket example #253 , you the message has to pass the channel name along in the message, but which broker/server should it go to?
  • A message provides a channel to reply (request/reply), again, which broker?
@stale
Copy link

stale bot commented Oct 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 29, 2019
@fmvilas fmvilas removed the stale label Oct 30, 2019
@jmaister
Copy link

jmaister commented Dec 3, 2019

Same issue here.

The "channels" section has already a "channel.operation.bindings" field, which does not apply for this problem.

As I have to make the code work, for the moment I added a non-official property called "channel.operation.binder" to the channel to point to the ID of the server.

asyncapi: '2.0.0'
...

servers:
  nats1:
    url: nats://10.10.10.10:4222
    description: Primary NATS server
    protocol: nats
  kafka1:
    url: 10.10.10.10:9092
    description: Primary Kafka server
    protocol: kafka

channels:
  multi_convert_request:
    subscribe:
      binder: nats1
      message:
        ...

  multi_convert_response:
    publish:
      binder: kafka1
      message:
        ...

@fmvilas
Copy link
Member

fmvilas commented Dec 3, 2019

Yeah, we'll work it out in future versions. In the meantime, make sure you use compatible property names so your AsyncAPI document is still valid. You can just rename your binder property to x-binder and everything should be fine.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 30 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️

@github-actions github-actions bot added the stale label Mar 12, 2020
@fmvilas fmvilas added keep-open Prevents stale bot from closing this issue or PR and removed stale labels Mar 13, 2020
@fmvilas fmvilas added this to the AsyncAPI specification 2.1.0 milestone Mar 13, 2020
@rvowles
Copy link

rvowles commented Jun 25, 2020

yay this is being added, we just had a question about this in our team

@GeraldLoeffler
Copy link
Contributor

Another use case are all kinds of "protocol adapter" apps, i.e., apps that read from server S1 using protocol P1 and forward messages to server S2 using protocol P2.

For example: Imagine an app that receives messages from an IBM MQ server and sends them to an MQTT server: it has a channel with a publish operation that must be linked to the IBM MQ server, and another channel with a subscribe operation that must be linked to the MQTT server. This should be expressed in one AsyncAPI document. Because if it were split into two separate AsyncAPI documents (one with IBM MQ as the server, the other with MQTT as the server) then the fact that the app essentially just routes incoming IBM MQ messages to an MQTT server is lost.

@smoya
Copy link
Member

smoya commented Apr 27, 2021

The concept behind #244 shows a more distributed-systems-oriented approach where servers can be grouped (e.g. clusters). Then Operations would just specify in which group(s) or cluster(s) can be found.

@derberg
Copy link
Member

derberg commented Oct 5, 2021

This is now supported by 2.2 release of the spec 🥳

@derberg derberg closed this as completed Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep-open Prevents stale bot from closing this issue or PR
Projects
None yet
Development

No branches or pull requests

7 participants