Message Management Commands
Thepaw messages commands allow you to create and manage messages that are based on your schema definitions.
Commands
messages list
List all messages in a project.Options
--project-id(required): The ID of the project
Examples
messages new
Create a new message based on a schema.Options
--project-id(required): The ID of the project--name(required): Name of the message--schema-id(required): The ID of the schema this message is based on--schema-version(required): The version of the schema to use--description: Description of the message
Examples
Understanding Messages
What is a Message?
A message is a concrete implementation of a schema used for:- Event definitions in event-driven architectures
- API request/response definitions
- Data transfer objects (DTOs)
- Queue message formats
Message vs Schema
- Schema: The abstract data structure definition
- Message: A specific use case of that schema
- Schema:
User(defines user data structure) - Messages:
UserCreatedEvent,UserUpdatedEvent,UserProfileResponse
Message Versioning
Messages are tied to specific schema versions:- When a schema updates, existing messages continue using their version
- Create new messages for new schema versions
- Allows gradual migration
Event-Driven Architecture
Messages are particularly useful for event-driven systems:Best Practices
Naming Conventions
- Events: Use past tense -
UserCreated,OrderShipped - Commands: Use imperative -
CreateUser,ShipOrder - Requests/Responses: Be descriptive -
GetUserRequest,UserProfileResponse
Message Organization
Group related messages:Schema Reuse
Multiple messages can use the same schema:Examples
API Message Definitions
Event Sourcing
Microservices Communication
Working with Servers and Resources
Messages are often used with servers and resources:Related Commands
- Schemas - Define data structures for messages
- Servers - Create servers for message transport
- Resources - Define topics/queues for messages
- Code Generation - Generate message handling code