Using events in services
Services can either send or receive events.
To add events to services you need to reference them within your service itself.
/services/Orders/index.md (example)
---
id: OrderService
... # other service frontmatter
receives:
# id of the event this service receives
- id: InventoryAdjusted
# The version of the message you want to add.
version: 0.0.1
sends:
# id of the event this service sends
- id: InventoryProcessed
# The version of the message you want to add.
version: 0.0.1
---
<!-- Markdown contents... -->
Read the guide to learn how to add events to your services..
Versioning​
When you reference an event in your service you need to specify the version of the event.
This allows you to document which versions of events your service interacts with.
This can be useful for migration plans and understanding which version of your events are being used in your architecture.
Always using the latest version
Referencing a message version is optional from your service. If no version is given then the latest is always used.