我希望在Reactor
中捕获EventBus
事件后,生成一个单独的线程(使用@HandleAfterCreate
或SpringBootApplication
)。我正面对IllegalStateException
,究竟发生了什么?我搜索了很多,发现调度程序不允许复制或存储调度对象。这是什么意思?请帮忙。
@Autowired
Reactor reactor
@HandleAfterCreate
void someFunction(Customer newCustomer) {
reactor.notify("customer-events", Event.wrap(customer)); //Exception Here
}
异常消息
java.lang.IllegalStateException: This Dispatcher has been shutdown
at reactor.event.dispatch.BaseDispatcher.dispatch(BaseDispatcher.java:42)
at reactor.event.dispatch.BaseLifecycleDispatcher.dispatch(BaseLifecycleDispatcher.java:28)
at reactor.core.Reactor.notify(Reactor.java:211)
at reactor.core.Reactor.notify(Reactor.java:223)
at com.gs.rainbow.cep.reactors.Publisher.publishCustomers(Publisher.java:27)
at com.gs.rainbow.cep.events.CustomerEventHandler.handleAfterCreate(CustomerEventHandler.java:51)
我的环境