guanaco-io / alerta

Camel OSGI bundles for error handling with Alerta (https://alerta.io/)
Apache License 2.0
0 stars 0 forks source link

AlertaRouteBuilderSupport does not work correctly with error handler #5

Closed gertv closed 4 years ago

gertv commented 4 years ago

If an error handler is defined with redelivery and the exchange fails on the first attempt but afterwards succeeds in the redelivery, the AlertaRouteBuilderSupport will still send a failure alert instead of a success alert.

In the handler method, the exception is still present but we should also look at the underlying exchange because it is no longer marked as failed (exchange.isFailed()false)

https://github.com/guanaco-io/alerta/blob/master/util/src/main/scala/io/guanaco/alerta/util/AlertaRouteBuilderSupport.scala#L60-L72