1

I am new to Axon framework. I have a doubt about saving the events in the event store by axon framework? just think, we are going to execute an execution and the axon server tries to save the events in to the event store. while that, an exception can occur because of a connection problem. Then what happens to the execution further?

Mafei
  • 3,063
  • 2
  • 15
  • 37

1 Answers1

0

That will mean the events aren't stored, @Mafei. Although that might feel off, please consider the following.

Axon Framework guides your applications to a solution using CQRS, DDD, and Event Sourcing. Especially the latter is important for the argument's sake.

If your application employs Event Sourcing, that means both your Projections are constructed through events, and your Command Models are used for business validation. Due to this, all your models are constructed based on events. In essence, the events in your Event Store (which might be Axon Server) are the sole source of truth.

If we circle back to your question of, "what happens if the event isn't stored through some error." Well, if it's not stored, then it simply didn't happen. None of your Projections or Command Models can use an event that isn't there. Hence, the change simply didn't happen.

Note that Axon Server and Framework will correctly propagate such an exception. Hence, you can act accordingly, like performing a retry or backing off if the connection fails persistently.

Steven
  • 6,936
  • 1
  • 16
  • 31