【问题标题】:What's the alternative to Camel BeanInvocation in camel 3.6.0骆驼3.6.0中骆驼BeanInvocation的替代品是什么
【发布时间】:2021-08-13 06:19:35
【问题描述】:

我正在将我们的项目从 Camel 2.24.1 迁移到 3.6.0。在代码中我们使用了 BeanInvocation,我们提到了在 bean 中调用的方法以及方法中的其他类。

org.apache.camel.component.bean.BeanInvocation 在 2.24.2 之后被弃用。

有没有其他方法可以实现这一点。

public void buildRequest(Exchange exchange) {
 BeanInvocation beanInvocation = new BeanInvocation();
 beanInvocation.setMethod(ExampleBean.class.getMethod("methodName", param1, param2);
    
 ....
 ....
 // Add the arguments to the bean invocation
 beanInvocation.setArgs(args);

 // Set the bean invocation object as the message body
 exchange.getIn().setBody(beanInvocation);
}

P.S:我是骆驼的新手,并试图理解这些概念。

【问题讨论】:

  • 你能告诉我们你完整的骆驼路线,以便我们提出一些替代方案吗?

标签: java reflection apache-camel spring-camel


【解决方案1】:

是的,它已被弃用。我不敢相信没有任何答案。

这里是它的指南。 - 不仅不推荐使用 BeanInvocation,所以我 建议对您的项目使用所有新方法。

https://camel.apache.org/manual/latest/camel-3-migration-guide.html - 阅读 apache 的本指南。 (没有任何说这是 BeanInvocation 的替代方案。您必须创建一个替代方案。它刚刚被删除。这意味着使用推荐方法。不是旧的。)

【讨论】:

  • 是的,别无选择。
猜你喜欢
  • 2011-12-13
  • 1970-01-01
  • 1970-01-01
  • 2023-04-02
  • 2014-10-27
  • 2022-01-11
  • 1970-01-01
  • 2019-02-15
  • 2015-05-05
相关资源
最近更新 更多