我想在捕获事件后生成一个单独的线程(使用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)
我的环境
- org.springframework.boot:spring-boot-starter-data-rest
- spring-boot-starter-data-jpa:1.2.6
- com.h2 数据库:h2:1.4.189
- org.projectreactor:reactor-spring:1.0.0