我有一个seda队列,我根据camel documentation
设置了queueSize选项我的路线如下:
from("seda:someQueue?concurrentConsumers=10&queueSize=10")
.process(someProcessor);
由于queueSize选项,我收到以下错误:
org.apache.camel.FailedToCreateRouteException:无法创建路由.... bla bla bla .. 有一个参数无法在端点上设置。如果参数拼写正确并且它们是端点的属性,请检查uri。未知参数= [{queueSize = 10}] ..... [stacktrace继续在这里]
有谁可以指出什么是错的? 我正在使用Java 8,Camel 2.9.13
答案 0 :(得分:2)
请注意,文档说选项queueSize仅为组件,这意味着您需要在SedaComponent
上配置它。换句话说,您不能像在上面的路线中那样在端点上配置它。
有关Camel组件的最新文档和更好的文档,请在以下位置浏览github页面:https://github.com/apache/camel/blob/master/camel-core/src/main/docs/seda-component.adoc
这些文档是最新的,并在不同的表中显示组件与端点选项,因此更容易了解差异。
答案 1 :(得分:1)
对于那些有相同问题的人,这就是我现在使用queueSize的方式
初始化一个新的seda组件
SedaComponent sedaComponent = new SedaComponent();
sedaComponent.setQueueSize(3);
context.addComponent("sedaComponent", sedaComponent);
然后在路线上使用此组件,如
from("seda:someEndPoint?concurrentConsumers=5")
.to("sedaComponent:someOtherSedaEndPoint?blockWhenFull=true");
答案 2 :(得分:0)
替换queueSize
size(query param in apache document)
from("seda:someQueue?concurrentConsumers=10&queueSize=10")
.process(someProcessor);