I tried use it in saga, but it didn’t trigger the ExceptionHandler even though the exception and stack trace was shown on the log, I wonder why. Here’s how the code looks like.
class TestSaga {
@StartSaga
@SagaEventHandler(associationProperty = "test")
fun on(event: EventA) {
Mono.error(IllegalArgumentException("Test handling from A"))
.block()!!
}
@SagaEventHandler(associationProperty = "test")
fun on(event: EventB) {
Mono.error(IllegalArgumentException("Test handling from B"))
.block()!!
}
@SagaEventHandler(associationProperty = "test")
fun on(event: EventC) {
Mono.error(IllegalArgumentException("Test handling from C"))
.block()!!
}
@ExceptionHandler
fun on(error: IllegalArgumentException) {
// doesn't trigger this handler
println("Exception handler tested")
}
}
I use axonframework version 4.4.8 and also use TrackingEventProcessor
I actually picked this up recently. So currently it does not work. And it will be going to work in 4.8. We might consider it a bug and also have the required changes in 4.7, not sure on that one through.
I’d appreciate it if this could be taken up as a bug. But I don’t know when the 4.8 release is planned? It would be great to have it before our release in May. Otherwise I have to figure out something else.
Not AFAIK, the annotation is relatively new, and the code for using it in Saga’s was just kind of missing. We have an internal meeting next Thursday. Once it’s added to the 4.7 branch we could have a release pretty soon after. We kind of plan to have 3 minor releases each year, which means the 4.8 should be around May.
Seems like this can be implemented with the ListenerInvocationErrorHandler. So I got it somewhat working. Although it would still be nice to have it work based on the annotation.
We discussed this today, and based on the changes needed, and because it’s not a bug in the traditional sense, we decided to move it to 4.8.0. That will be out hopefully in May or June, with, among other things, some improvements to monitoring and dead letter queue. This is the related PR if you are interested.