【问题标题】:ResolveEndpointFailedException: "There are 1 parameters that couldn't be set on the endpoint." when creating endpoint with the endpoint DSLResolveEndpointFailedException:“有 1 个参数无法在端点上设置。”使用端点 DSL 创建端点时
【发布时间】:2019-12-16 17:40:55
【问题描述】:

我正在从 Camel 2 迁移到 Camel 3,我渴望使用 here 描述的 Endpoint DSL,但是在迁移我的端点时遇到了问题。

我曾经有一个写入 RabbitMQ 队列的路由,如下所示:

.toD("rabbitmq:$vhost?connectionFactory=#customConnectionFactory&queue=$responseQueueName&autoDelete=false&routingKey=$responseQueueName&bridgeEndpoint=true")

我迁移到的地方

.toD(
    rabbitmq(vhost)
    .connectionFactory(connectionFactory)
    .queue(responseQueueName)
    .autoDelete(false)
    .routingKey(responseQueueName)
    .bridgeEndpoint(true)

但是,Camel在创建endpoint的时候,还添加了一个hash参数,不能设置到endpoint,导致如下异常:

无法解析端点:rabbitmq://MYVHOST?autoDelete=false&bridgeEndpoint=true&hash=753a744c&queue=MYQUEUENAME&routingKey=MYQUEUENAME,原因是:无法在端点上设置 1 个参数。如果参数拼写正确并且它们是端点的属性,请检查 uri。未知参数=[{hash=753a744c}]

我的端点语法是正确的,AFAIK,因为我使用的是在我的路由的 from 子句中以相同方式创建的端点。

【问题讨论】:

  • 看起来像一个错误,欢迎您创建 Jira 问题。作为一种解决方法,您可以使用.connectionFactory("#customConnectionFactory")
  • 问题不在于连接工厂本身,而在于toD 不接受哈希参数。
  • 啊,是的,当您引用连接工厂实例时看起来像它,然后 uri 构建器通过哈希占位符生成它
  • 谢谢我已经重现了这个问题并记录了一个错误:issues.apache.org/jira/browse/CAMEL-14306

标签: rabbitmq apache-camel


【解决方案1】:

原来问题在于使用toD 指定的输出端点,将其切换为常规to 解决了这个问题。

【讨论】:

    猜你喜欢
    • 2014-04-29
    • 1970-01-01
    • 2014-04-10
    • 1970-01-01
    • 2015-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-08
    相关资源
    最近更新 更多