骆驼超时

时间:2015-04-27 14:37:11

标签: jms apache-camel

我正在使用Camel中的split-aggregate功能来拆分一些JMS客户端之间的工作。 Camel路由定义(使用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$2.doInProducer(ProducerCache.java:375)
    at org.apache.camel.impl.ProducerCache$2.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秒后仍会抛出异常。

我有什么想法可以增加这里生效的超时?

1 个答案:

答案 0 :(得分:1)

超时来自vm端点,请参阅(vm extends seda)

您可以在那里设置更高的超时,或将其配置为不等待任务完成。