Exceptions propagated from the transactional event listener are handled by TransactionSynchronizationUtils
and are not rethrown.
However, the lack of a configurable error handler for these exceptions makes it difficult to customize exception handling during transactional event processing.
To address this, I added an abstract error handler that can be defined as follows:
@Component
public abstract class TransactionalEventErrorHandlerImpl extends TransactionalEventErrorHandler {
// can inject other beans
@Override
public void handle(ApplicationEvent event, @Nullable Throwable ex) {
// custom logic
}
}
Comment From: pivotal-cla
@hyh1016 Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
Comment From: pivotal-cla
@hyh1016 Thank you for signing the Contributor License Agreement!