Message Formats
Define message schemas, content types, and structure for event-driven communication
Messages in AsyncAPI are defined in the components.messages
section and referenced from channels and operations. They define the structure and format of data exchanged through your event-driven API.
asyncapi.yml
Message payload
The payload defines the structure of the message data:
asyncapi.yml
Message headers
You can define headers that are sent with your messages:
asyncapi.yml
Content types
AsyncAPI supports various content types for messages:
asyncapi.yml
Message examples
Provide concrete examples to help developers understand your message format:
asyncapi.yml
Message traits
Use traits to share common message properties across multiple messages:
asyncapi.yml
This approach helps maintain consistency across your message definitions while reducing duplication.