Interface EventExceptionHandler
- All Known Implementing Classes:
LoggingExceptionHandler, RetryExceptionHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Event Exception Handler Interface
事件异常处理器接口
Interface for handling exceptions that occur during event processing.
用于处理事件处理过程中发生的异常的接口。
Features | 主要功能:
- Exception handling - 异常处理
- Error logging - 错误日志记录
- Retry support - 重试支持
Usage Examples | 使用示例:
EventExceptionHandler handler = (event, exception, listenerName) -> {
log.error("Event processing failed: {}", event.getId(), exception);
};
OpenEvent eventBus = OpenEvent.builder()
.exceptionHandler(handler)
.build();
Security | 安全性:
- Thread-safe: Yes (stateless) - 线程安全: 是(无状态)
- Since:
- JDK 25, opencode-base-event V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidhandleException(Event event, Throwable exception, String listenerName) Handle an exception that occurred during event processing 处理事件处理过程中发生的异常
-
Method Details
-
handleException
Handle an exception that occurred during event processing 处理事件处理过程中发生的异常- Parameters:
event- the event being processed | 正在处理的事件exception- the exception that occurred | 发生的异常listenerName- the name of the listener that threw | 抛出异常的监听器名称
-