Skip to main content

Assigning events to services

Services can either send or receive events, commands and queries.

To add messages to services you need to reference them within your service itself by adding the id. The version is optional and if not provided the latest version will be used.

/services/Orders/index.mdx (example)
---
id: OrderService
... # other service frontmatter
receives:
# id of the message this service receives
- id: OrderPlaced
# (optional) The version of the message you want to add
version: 0.0.1
sends:
# id of the message this service sends
- id: PaymentProcessed
---

<!-- Markdown contents... -->

Versioning​

When you reference a message in your service you can specify the version of the message.

This allows you to document which versions of messages your service interacts with.

If you don't specify a version the latest version will be used.