Camel PollEnrich拒绝"文件位置"没有启动,但处于状态:已停止

时间:2014-09-24 21:55:04

标签: apache-camel

为我的英语道歉,已经很晚了,我很累,而且没有多大意义

我在Camel的Quartz cron-jobs中查看了大约4个民意调查文件位置

我以10秒的间隔轮询了4次

// portFolioHoldingsCron = 0/10+*+*+?+*+* )
// the first cron is just evaluates quartz://holdingsRefreshTimer?portfolioHoldingsCron=0/10+*+*+?+*+*

pollEnrich to

        from( bridge.components().quartz( "holdingsRefreshTimer", portfolioHoldingsCron ) )
        .log( "PORTFOLIO HOLDINGS TIMER EVENT")
        .pollEnrich( portfolioHoldingsCamelFromUrl, portfolioPollTimeout )
        .choice()
            .when(  body().isNull() )
            .log( "No Firm data retreived from " + portfolioFirmsCamelFromUrl )
            // END
        .otherwise()
                .process( new Processor() {
                    @Override
                    public void process(Exchange exchange) throws Exception {

                    }
                })
        .log("PORTFOLIO HOLDINGS RECEIVED AND PROCESSING")
        .unmarshal()
        .bindy(BindyType.Csv, Holding.class)
        .log("Holdings unmarshalled")

在一段任意时间(例如30秒)之后,路线突然全部中断(不同路线上有很多这些消息)

我从未告诉他们停止或关闭。我不知道为什么会这样,这很令人困惑

我得到的例外是:

org.quartz.JobExecutionException: java.util.concurrent.RejectedExecutionException: PollingConsumer on Endpoint[file://inbox/holding?noop=true] is not started, but in state: Stopped [See nested exception: java.util.concurrent.RejectedExecutionException: PollingConsumer on Endpoint[file://inbox/holding?noop=true] is not started, but in state: Stopped]
at org.apache.camel.component.quartz.QuartzEndpoint.onJobExecute(QuartzEndpoint.java:117)
at org.apache.camel.component.quartz.CamelJob.execute(CamelJob.java:54)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: java.util.concurrent.RejectedExecutionException: PollingConsumer on Endpoint[file://portfolio-inbox/holding?noop=true] is not started, but in state: Stopped
at org.apache.camel.impl.EventDrivenPollingConsumer.receive(EventDrivenPollingConsumer.java:84)
at org.apache.camel.processor.PollEnricher.process(PollEnricher.java:172)
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)

2 个答案:

答案 0 :(得分:0)

似乎在10秒或更短的计时器上使用石英会导致这些pollEnrich问题出现

当我将时间设置为15秒和更长时间时,问题就结束了

答案 1 :(得分:0)

您可能希望使用seda作为解决方法;

从(石英:...) 。为了(" SEDA:下一个&#34);

从(" SEDA:下一个&#34) .pollEnrich() ...