Apache骆驼破坏者组件

时间:2016-03-04 14:12:29

标签: java apache-camel

我正在尝试建立一个基于netty的TCP服务器,它可以在一个连接中处理多个请求。我在myHandler中使用disruptor并延迟5秒进行测试。我的路线是,

this.from("netty4:tcp://localhost:7000?sync=true&synchronous=false&encoder=#myEncoder&decoder=#myDecoder").to("disruptor:myDisruptor"); 

this.from("disruptor:myDisruptor?concurrentConsumers=20").to("bean:myHandler"); 

即使在disruptor上有concurrentConsumers = 20之后,我的事务也会按顺序处理。可能是什么原因?如何使消息处理程序异步?以下路线适合我,

this.from("netty4:tcp://localhost:7000?sync=true&synchronous=false&encoder=#myEncoder&decoder=#myDecoder").threads(20).to("bean:myHandler");

0 个答案:

没有答案