在 http4-component 范围内完成交换
Completed exchange in the scope of http4-component
我有一个简单的 Camel 路由,它使用来自 ActiveMQ 的消息,处理它们并将它们转发到 Rest web 服务:
from("activemq:MyQueue").process("MyProcessor").to("http4:uri");
我在 activemq-component 的 connectionfactory 中配置 concurrentConsumers=100。
在文档中:
if asyncConsumer is disabled(default) then the Exchange is fully processed before the JmsConsumer will pickup the next message from the JMS queue
问题:
在我的路由中,每条消息的交换什么时候被完全处理? http-callee 收到 http 响应后?如果是这样,我假设,我的路由配置意味着:
- 开始时,每个消费者消费1条消息并转发到http
- 这 100 个消费者中的每一个都在等待,并且只有在当前 http 调用从当前消息获得 http 响应时才会再次消费。
另一个问题:
我发现 http4 组件选项 connectionsPerRoute=20 的默认值。因为我有 100 个消费者,我应该设置 connectionsPerRoute=100 吗?
谢谢,
哈迪
每个jms线程在彼此不认识的情况下同时运行。在你的例子中同时处理100个线程没有得到blocked.You不需要在http组件的线程数中发挥,因为这是从头到尾通过jms线程完成的。
我有一个简单的 Camel 路由,它使用来自 ActiveMQ 的消息,处理它们并将它们转发到 Rest web 服务:
from("activemq:MyQueue").process("MyProcessor").to("http4:uri");
我在 activemq-component 的 connectionfactory 中配置 concurrentConsumers=100。
在文档中:
if asyncConsumer is disabled(default) then the Exchange is fully processed before the JmsConsumer will pickup the next message from the JMS queue
问题: 在我的路由中,每条消息的交换什么时候被完全处理? http-callee 收到 http 响应后?如果是这样,我假设,我的路由配置意味着:
- 开始时,每个消费者消费1条消息并转发到http
- 这 100 个消费者中的每一个都在等待,并且只有在当前 http 调用从当前消息获得 http 响应时才会再次消费。
另一个问题: 我发现 http4 组件选项 connectionsPerRoute=20 的默认值。因为我有 100 个消费者,我应该设置 connectionsPerRoute=100 吗?
谢谢, 哈迪
每个jms线程在彼此不认识的情况下同时运行。在你的例子中同时处理100个线程没有得到blocked.You不需要在http组件的线程数中发挥,因为这是从头到尾通过jms线程完成的。