我使用 spring boot 2.5.3 版、spring-cloud-stream-binder-kafka-stream 3.1.3 版和 kafka-clients 2.8.0 版。我想对 kafka 流中的未捕获异常处理程序使用 REPLACE_THREAD 选项。
但我无法使用它,因为 StreamsBuilderFactoryBeanConfigurer(2.6.7 版本)不支持
fb.setUncaughtExceptionHandler(ex -> { log.error("Uncaught exception: ", e); snsService.publish("UncaughtException thrown"); return StreamsUncaughtExceptionHandler.StreamThreadExceptionResponse.REPLACE_THREAD; });
是否可以用 替换流线程fb.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler()
?
提前致谢!