Hi Everyone,
I feel like my question got a bit side-tracked, but I hope Bruno got his answers (no hard feelings :)).
It did make me question if I expressed myself correctly, and make me think about how to turn this into a small example. It turns out, I wrote down the wrong question myself, let me correct that.
The issue:
The system is using EventStorageEngine (with JDBC) [and not SimpleCommandBus]. (Don’t ask how I got that mixed up)
The good:
Non-db exceptions in the event handlers are treated as expected (Axon isolates them i.e. “Continuing processing with next listener”)
The bad:
DB-exceptions (wrong column name, table missing) in the event handlers seem to trigger a transaction rollback, and the command-handler looks to be operating in the same transaction (or the apply(event) is). So the event is not stored either.
(The log also reports, probably in vain, “Continuing processing with next listener” in this case)
The ugly:
The command-handler reports nothing about the rollback, and to the caller it is indistinguishable from a success.
In the case of commandGateway.sendAndWait, the return value from the commandHandler is returned.
In the case of commandGateway.send with callback, the onSuccess callback is invoked.
Hope this makes the issue more clear.
Let me know if you need me to create a project that showcases this issue.
Cheers,
Tim