0

We are using Akka.net with persistence (using PostgreSQL) and storing custom events in the event store. During development/testing events may be added to the event store which at some point in the future I will wish to delete/ignore. What is the best way to go about this? I know I can manually remove them or make the event idempotent so that it doesn't change the actors state. Ideally I would also like any events which fail to deserialize from the event store (say because the required deserialization type no longer exists) to be ignored. Is it possible to ignore deserialization failures when replaying Akka.net persistence events? At present if any event fails to deserialize the actor remains in an inconsistent state. I have tried searching and not found anything. Thanks

Nafeez Abrar
  • 1,045
  • 10
  • 27
Tim Trewartha
  • 364
  • 3
  • 10
  • If this is for testing/development, why just don't clear your journal and replenish it with valid (at the current state of development) events? – Bartosz Sypytkowski Jan 10 '18 at 10:47
  • Yeah it's mostly for development, and that could work. I would still like to know if it's possibly to tell Akka to ignore deserialization failures, since at the moment it does not fail gracefully, the actor becomes unresponsive. – Tim Trewartha Jan 10 '18 at 11:08
  • You can use event adapters to update events stored far in the past to a current state of system. But ignoring failed serialization would make your system end up in inconsistent state - as you'd recover the state of the application from incomplete data. Event schema evolution is part of the eventsourcing strategy. I could recommend a great book about versioning in eventsourcing systems by Greg Young: https://leanpub.com/esversioning/read – Bartosz Sypytkowski Jan 12 '18 at 08:00

0 Answers0