首页 文章

在SEDA上设置queueSize选项

提问于
浏览
0

我有一个seda队列,我根据camel documentation设置queueSize选项

我的路线看起来像:

from("seda:someQueue?concurrentConsumers=10&queueSize=10")
.process(someProcessor);

由于queueSize选项,我收到以下错误:

org.apache.camel.FailedToCreateRouteException:无法创建路由.... bla bla bla ..在 endpoints 上有1个参数无法设置 . 如果参数拼写正确并且它们是 endpoints 的属性,请检查uri . 未知参数= [] ..... [stacktrace在这里继续]

谁能指出什么是错的?我正在使用Java 8,Camel 2.9.13

2 回答

  • 2

    请注意,文档说选项queueSize只是 component ,这意味着您需要在 SedaComponent 上配置它 . 换句话说,您无法像在上面的路线中那样在 endpoints 上配置它 .

    有关Camel组件的最新文档和更好的文档,请在以下位置浏览github页面:https://github.com/apache/camel/blob/master/camel-core/src/main/docs/seda-component.adoc

    这些文档是最新的,并在不同的表中显示组件与 endpoints 选项,因此更容易了解其中的差异 .

  • 1

    对于那些有相同问题的人,这就是我现在使用queueSize的方式

    初始化一个新的seda组件,

    SedaComponent sedaComponent = new SedaComponent();
            sedaComponent.setQueueSize(3);
            context.addComponent("sedaComponent", sedaComponent);
    

    然后在路线上使用此组件,如,

    from("seda:someEndPoint?concurrentConsumers=5")
                                 .to("sedaComponent:someOtherSedaEndPoint?blockWhenFull=true");
    

相关问题