Spring,HandleAfterCreate,Reactor,EventBus IllegalArgumentException

时间:2015-10-23 15:58:40

标签: spring spring-boot spring-data-jpa project-reactor

我希望在Reactor中捕获EventBus事件后,生成一个单独的线程(使用@HandleAfterCreateSpringBootApplication)。我正面对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:弹簧引导起动数据静止
  • 弹簧引导起动数据JPA:1.2.6
  • com.h2database:H2:1.4.189
  • org.projectreactor:反应器弹簧:1.0.0

0 个答案:

没有答案