I recently added a context.doAfterCommit(Runnable), but this is only run if everything goes OK.
It might be nice to be able to have some code run after the lambda, whether or not things went OK. It could accept any outbound Exception. With this, it could be possible to do compensating SQL operations if we ended up in a "VERY BAD!" situation, reducing the problem if it happens? This scenario might even warrant a dedicated method?
An obvious problem here is that this method would be run after each retry. That is, for a default ActiveMQ setting, it would be run 7 times. So the method name context.doFinally(..) is really not appropriate, as that would give the wrong impression.
I recently added a context.doAfterCommit(Runnable), but this is only run if everything goes OK.
It might be nice to be able to have some code run after the lambda, whether or not things went OK. It could accept any outbound Exception. With this, it could be possible to do compensating SQL operations if we ended up in a "VERY BAD!" situation, reducing the problem if it happens? This scenario might even warrant a dedicated method?
An obvious problem here is that this method would be run after each retry. That is, for a default ActiveMQ setting, it would be run 7 times. So the method name
context.doFinally(..)
is really not appropriate, as that would give the wrong impression.