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

Allow grouping topics across multiple broker clusters #244

Closed
lwielek opened this issue Jul 25, 2019 · 4 comments
Closed

Allow grouping topics across multiple broker clusters #244

lwielek opened this issue Jul 25, 2019 · 4 comments
Labels
keep-open Prevents stale bot from closing this issue or PR

Comments

@lwielek
Copy link

lwielek commented Jul 25, 2019

Scenario
A single application connects to 2 (or more) broker clusters.
It publishes/subscribes to topics maintained by both broker clusters.
Topics are not being shared among brokers - a topic that exists on broker 1, does not exist on broker 2.

Problem
It is not possible to document the application's APIs in a single Async-API specification.
From the spec, it is not possible to know, which topic is maintained on which broker cluster.

Proposal
Extend the specification with 2 additional fields.

  • server.group (string) - all servers that belong to a single cluster can be identifier by the group (cluster) name. Optional field. If not present, the server is assigned to a default group.
  • topic.serverGroup (string) - the broker group (cluster) name, where the topic exists. Optional field. If not present, the default group is assumed.

Example:

servers:
  - url: api.streetlights.smartylighting.com:1234
    scheme: mqtt
    description: API broker
    group: api
  - url: audit.streetlights.smartylighting.com:1234
    scheme: mqtt
    description: Audit broker
    group: audit
  
topics:
  event.{streetlightId}.lighting.measured:
    serverGroup: api
    publish:
      $ref: '#/components/messages/lightMeasured'
  event.lighting.audit:
    serverGroup: audit
    publish:
      $ref: '#/components/messages/auditMessage'

Workaround
Possible workaround is to create 2 separate specifications - separate for broker 1 topics, and broker 2 topics.

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

derberg commented Mar 26, 2021

I'm paying out with websocket atm. I have an API that has 2 different connection points, we can call it private and public. One server is opened, and the other one is secured with token. As typical Websocket, there is one channel, one endpoint. There are messages in the API that can go only to private server.

So I don't even need to wire a topic (channel) with the server, but actually a message with the server.

Possible mitigation, I can have 2 AsyncAPI files of course that share messages/schemas with $ref. Nevertheless would be nice to look more into the subject

@derberg
Copy link
Member

derberg commented Oct 5, 2021

possible with AsyncAPI 2.2 🥳

@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

3 participants