骆驼超时
Timeouts in camel
我正在使用 Camel 中的拆分聚合功能在一些 JMS 客户端之间拆分一些工作。
骆驼路线定义(使用groovy)如下:
from("vm:getQuotes")
.split(new MethodCallExpression("requestSplitter", "splitAmongstBots"), new ArrayListAggregationStrategy())
.to("jms:queue:quoteRequests?requestTimeout=${responseTimeout}s")
.unmarshal().json(JsonLibrary.Jackson)
.end()
JMS 客户端可能需要大约 15 到 90 秒来处理任务。
我在初始拆分后 30 秒看到此异常:
Caused by: org.apache.camel.ExchangeTimedOutException: The OUT message was not received within: 30000 millis. Exchange[Message: {village=CHEC}]
at org.apache.camel.component.seda.SedaProducer.process(SedaProducer.java:144)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
at org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:68)
at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:375)
at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:343)
at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:233)
at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:343)
at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:201)
at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:128)
at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:115)
at org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeader(DefaultProducerTemplate.java:182)
... 116 common frames omitted
我尝试在调用 split
之后将此行添加到路由中:
.timeout(1000L * 60)
但无济于事 - 30 秒后仍然抛出异常。
关于如何增加此处生效的超时的任何想法?
超时来自 vm 端点,参见(vm extends seda)
您可以在那里设置更高的超时时间,或者将其配置为不等待任务完成。
我正在使用 Camel 中的拆分聚合功能在一些 JMS 客户端之间拆分一些工作。 骆驼路线定义(使用groovy)如下:
from("vm:getQuotes")
.split(new MethodCallExpression("requestSplitter", "splitAmongstBots"), new ArrayListAggregationStrategy())
.to("jms:queue:quoteRequests?requestTimeout=${responseTimeout}s")
.unmarshal().json(JsonLibrary.Jackson)
.end()
JMS 客户端可能需要大约 15 到 90 秒来处理任务。 我在初始拆分后 30 秒看到此异常:
Caused by: org.apache.camel.ExchangeTimedOutException: The OUT message was not received within: 30000 millis. Exchange[Message: {village=CHEC}]
at org.apache.camel.component.seda.SedaProducer.process(SedaProducer.java:144)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
at org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:68)
at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:375)
at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:343)
at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:233)
at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:343)
at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:201)
at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:128)
at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:115)
at org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeader(DefaultProducerTemplate.java:182)
... 116 common frames omitted
我尝试在调用 split
之后将此行添加到路由中:
.timeout(1000L * 60)
但无济于事 - 30 秒后仍然抛出异常。
关于如何增加此处生效的超时的任何想法?
超时来自 vm 端点,参见(vm extends seda)
您可以在那里设置更高的超时时间,或者将其配置为不等待任务完成。