简体   繁体   English

在Camel v2.16.0中替换Deprecated beanRef()

[英]Replacement of Deprecated beanRef() in Camel v2.16.0

We are upgrading from Camel v2.13 to v2.16 and discovered that beanRef() has been marked as deprecated. 我们正在从Camel v2.13升级到v2.16,并发现beanRef()已被标记为已弃用。 What is the replacement/alternative recommended by Apache Camel. Apache Camel推荐的替代品/替代品是什么? I was unable to find anything useful on Camel v2.16.0 Documentation site. 我无法在Camel v2.16.0文档站点上找到任何有用的东西。 Even updated examples are not yet available. 甚至还没有更新的例子。

beanRef() is syntax within Java DSL Bean Language of Camel. beanRef()是Camel的Java DSL Bean语言中的语法。

I assume that you are talking about the ProcessorDefinition class. 我假设你在谈论ProcessorDefinition类。

The javadoc comments say to use the bean(...) methods as replacements for the beanRef(...) methods. javadoc注释说使用bean(...)方法作为beanRef(...)方法的替代。

Source reference: https://github.com/apache/camel/blob/6dae060eeec8b49531df5d6828030f4ef037f6eb/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java 来源参考: https//github.com/apache/camel/blob/6dae060eeec8b49531df5d6828030f4ef037f6eb/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java

from(...).to("bean:beanId?method=myMethod")

要么

from(...).bean("beanId", "myMethod")

Here is a list of depricated methods of beanRef in Camel 2.16.3 以下是Camel 2.16.3中beanRef的depricated方法列表

org.apache.camel.model.ProcessorDefinition. org.apache.camel.model.ProcessorDefinition。 beanRef(String) beanRef(字符串)
use ProcessorDefinition.bean(Object) 使用ProcessorDefinition.bean(Object)

org.apache.camel.model.ProcessorDefinition. org.apache.camel.model.ProcessorDefinition。 beanRef(String, boolean) beanRef(String,boolean)
use ProcessorDefinition.bean(Object, String, boolean) 使用ProcessorDefinition.bean(Object,String,boolean)

org.apache.camel.model.ProcessorDefinition. org.apache.camel.model.ProcessorDefinition。 beanRef(String, String) beanRef(String,String)
use ProcessorDefinition.bean(Object, String) 使用ProcessorDefinition.bean(Object,String)

org.apache.camel.model.ProcessorDefinition. org.apache.camel.model.ProcessorDefinition。 beanRef(String, String, boolean) beanRef(String,String,boolean)
use ProcessorDefinition.bean(Object, String, boolean) 使用ProcessorDefinition.bean(Object,String,boolean)

org.apache.camel.model.ProcessorDefinition. org.apache.camel.model.ProcessorDefinition。 beanRef(String, String, boolean, boolean) beanRef(String,String,boolean,boolean)
The option multiParameterArray is deprecated. 不推荐使用multiParameterArray选项。

Source Reference : http://static.javadoc.io/org.apache.camel/camel-core/2.16.3/deprecated-list.html 来源参考: http//static.javadoc.io/org.apache.camel/camel-core/2.16.3/deprecated-list.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM