akka / akka-projection

Akka Projections is intended for building systems with the CQRS pattern, and facilitate in event-based service-to-service communication.
https://doc.akka.io/docs/akka-projection/current/
Other
99 stars 34 forks source link

1:N mapping for events for akka projection #599

Open sebastian-alfers opened 2 years ago

sebastian-alfers commented 2 years ago

A single event exposed for a projection can be mapped in to multiple events that provide a single atomic commit for the "batch".

johanandren commented 2 years ago

To clarify, this issue is for adding API for hooking up an event adapter from Akka Persistence and automatically apply that. Specifically the request is about when a single event in the database is mapped to multiple events.

As far as I see it is currently possible in for example exactly-once by calling the adapter manually and making sure all the mapped events are committed in the same transaction. A specific API for plugging in the adapter would only provide a small convenience in my opinion.

sebastian-alfers commented 2 years ago

Thanks @johanandren for your additional clarification.

Another aspect of this potential feature would be how to provide control over committing the event that was mapped to multiple events by the event adapter.

patriknw commented 2 years ago

I think there is a high risk that the offset management will not work and that may result in "lost" events. Adding more features for "control over committing" seems overkill for such a niche feature. I think this should be handled in the application domain.