【问题标题】:Exception in FluentProducerTemplate in Apache Camel after upgrade to 3.7.2升级到 3.7.2 后,Apache Camel 中的 FluentProducerTemplate 出现异常
【发布时间】:2021-02-12 19:24:55
【问题描述】:

我对 3.7.2 有以下依赖:

<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-spring-boot-dependencies</artifactId>
<version>3.7.2</version>

我在代码中有这个:

fluentProducerTemplate.to("direct:myenpoint");
fluentProducerTemplate.send();

此代码在升级之前一直有效,但现在它抛出:

java.lang.IllegalArgumentException:FluentProducerTemplate 上没有配置端点。您可以使用 to(uri)` 配置端点

现在我无法弄清楚为什么它抱怨将端点配置为端点在to(endpoint) 调用中明确设置。我在他们的文档中找不到任何内容。

【问题讨论】:

    标签: apache-camel spring-camel


    【解决方案1】:

    它是一个流利的构建器,所以你应该像这样使用它:

    template.to("xxx").send()
    

    【讨论】:

      【解决方案2】:

      我发现端点必须设置在fluentProducerTemplate.setDefaultEndpoint(startingEndpoint);

      错误消息具有误导性。而且,我不确定为什么 to(端点)仍然存在。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-05-29
        • 2020-06-02
        • 1970-01-01
        • 2015-04-18
        • 2022-09-23
        • 1970-01-01
        相关资源
        最近更新 更多