We want to use Domain Event to build an application that reacts to well-defined events.
The key is to have a meaningful event defined for a bounded domain (as defined in Domain Driven Design).
Defining an event schema is as powerful as defining a REST API endpoint: it is a contract.
When using an Avro Schema the contract can evolve with forward and backward compatibility, this means that an old producer can be mixed with new consumer or the reverse: new producer with the old consumer.
Domain Events are much more useful than generic event trying to match all domains using a map, this kind of event cannot evolve and are easily corrupted between domains, they don't define any contract.
We want to offer an EP to contribute Domain Events Producer.
Few possible Domain Events:
- audit, basically what is logged in the audit backend
- document, changes used by reindexing, rendering, invalidation
- blob, changes used by picture rendition, fulltext extraction, quota, GC
- directory, changed on user/group/vocabulary, invalidation, alerting
- session, user interaction with the UI, analytics
This Epic supersede the "Event Sourcing Producer"
NXP-26939, it takes the same approach of defining a single sync listener enlisted to the transaction but it
- puts emphasis on defining a schema by domain event.
- uses different partitioned streams depending on the domain removing the need of a router computation