Apache Camel concurrentConsumers vs threads

*爱你&永不变心* 提交于 2019-12-05 23:56:08

The JMS component has built-in thread pooling, which scales very well up and down depending on number of message queing up.

So just use that

 from("jms:queue:start?concurrentConsumers=5")
   .bean(new SomeBean());

You can specify a max also so there is a range

 from("jms:queue:start?concurrentConsumers=5&maxConcurrentConsumers=10")
   .bean(new SomeBean());
Willem Jiang

If you want to check the JMS thread pool, you need to change the route like this

from("jms:queue:start?concurrentConsumers=5")
   .bean(new SomeBean())
   .threads(3, 3, "replyThread")
   .bean(new SomeBean());

SomeBean can show you that different thread pools are used in the camel route.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!