Lagom Message Broker API provides the functionality to forward the events generated by Persistent Entity to other microservices via a broker.
PersistentEntity briefly had the following flow:
- Receive commands.
- Generate events. Persist them in the event store.
- Use events to update the state.
- The events are then available on the read side (CQRS).
The last operation, of forwarding the events to the read side, can be further enhanced by forwarding it to another microservice spontaneously. The other microservice would receive the events and do its respective operations based on the events. In fact, the application can be split by carving out the read side as a separate microservice.
Currently, there is only Apache Kafka-based implementation available for Lagom Message Broker API. API implementations for other messaging brokers are currently a work in progress...