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

Add message type to describe Event/Command/Other #1074

Open
rj93 opened this issue Nov 3, 2024 · 5 comments
Open

Add message type to describe Event/Command/Other #1074

rj93 opened this issue Nov 3, 2024 · 5 comments
Labels
💭 Strawman (RFC 0) RFC Stage 0 (See CONTRIBUTING.md)

Comments

@rj93
Copy link

rj93 commented Nov 3, 2024

Messages are frequently either considered to be Commands or Events, there is even a brief section in the docs about it.

However the message spec doesn't currently have anyway to differnaitate these types of messages.

This could potentially be useful in the code generators to either implement "server" or "client" implementations.

Servers would generate the listeners for commands, and emitters for events. While clients would generate the inverse.

@rj93 rj93 added the 💭 Strawman (RFC 0) RFC Stage 0 (See CONTRIBUTING.md) label Nov 3, 2024
Copy link

github-actions bot commented Nov 3, 2024

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@ishyverma
Copy link

Hey! @rj93 can you tell me exactly how to give the message the type server or client ? I want to contribute to this issue. Thanks !!😊

@Manush-2005
Copy link

Hey @rj93 , I would like to take up this issue.

@ashug06
Copy link

ashug06 commented Jan 10, 2025

Hi @rj93 ! I'm Ashutosh goyal, a contributor eager to help with the AsyncAPI project. I’m excited to be involved in improving the specifications and learning more about the project. Looking forward to collaborating with everyone here!

@shwetd19
Copy link

shwetd19 commented Feb 8, 2025

Hey @rj93! This is a great idea—it could make AsyncAPI specs more expressive and improve code generation. Message classification is a key part of event-driven architectures, so formalizing it in the spec makes a lot of sense.

Building on this, what do you think about adding a messageType field to the Message Object with possible values like:

  • event – A notification about something that happened
  • command – A request to perform an action
  • query – A request that returns data
  • document – A message that represents a data snapshot

This could make things clearer for code generators while still being flexible for different messaging patterns. We’d also need to decide if it should be a required field or optional.

I’d love to contribute and help work through the technical details! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💭 Strawman (RFC 0) RFC Stage 0 (See CONTRIBUTING.md)
Projects
None yet
Development

No branches or pull requests

5 participants