Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/309.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 驼峰聚合器:在第一次失败时停止路由,并在存储库中保留所有消息_Java_Apache Camel - Fatal编程技术网

Java 驼峰聚合器:在第一次失败时停止路由,并在存储库中保留所有消息

Java 驼峰聚合器:在第一次失败时停止路由,并在存储库中保留所有消息,java,apache-camel,Java,Apache Camel,我已经按如下方式设置了聚合器 LevelDBAggregationRepository repository = new LevelDBAggregationRepository(REPO_NAME, repoLocation+"/"+REPO_NAME+".dat"); repository.setUseRecovery(true); repository.setMaximumRedeliveries(3); repository.setRecoveryI

我已经按如下方式设置了聚合器

    LevelDBAggregationRepository repository = new LevelDBAggregationRepository(REPO_NAME, repoLocation+"/"+REPO_NAME+".dat"); 
    repository.setUseRecovery(true); 
    repository.setMaximumRedeliveries(3); 
    repository.setRecoveryInterval(3000); 
    repository.setDeadLetterUri("mock:dead"); 

    from(UPDATE_ENDPOINT) 
            .aggregate(header("fileId"), new ESSessionAggregationStrategy()) // aggregates into an arraylist 
            .aggregationRepository(repository) 
            .completionPredicate(constant(false)) 
            .to("es://bulk") // my elasticsearch component 
我通过发送带有交换头的消息来刷新所有聚合。聚合\u完成\u所有\u组=true

如果elasticsearch组件不可用,我希望使用存储库中的所有消息停止路由。基本上,我不希望任何消息被移动到死信队列中

您可以使用以编程方式控制路由状态

另请参见如何从路由停止路由