Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. What is the replacement/alternative recommended by Apache Camel. I was unable to find anything useful on Camel v2.16.0 Documentation site. Even updated examples are not yet available.

beanRef() is syntax within Java DSL Bean Language of Camel.

like image 885
DolphinJava Avatar asked Nov 10 '15 14:11

DolphinJava


People also ask

Is Apache Camel outdated?

It's especially suited to application integration – that means it's good if you need to consume, transform and route data between applications. Apache Camel is even more relevant today in the cloud era, where the number of applications in a typical enterprise just seems to be growing bigger and bigger.

What is Java DSL in camel?

Camel uses a Java Domain Specific Language or DSL for creating Enterprise Integration Patterns or Routes in a variety of domain-specific languages (DSL) as listed below: Java DSL - A Java based DSL using the fluent builder style.

What is apache Camel used for?

Apache Camel ™ is a versatile open-source integration framework based on known Enterprise Integration Patterns. Camel empowers you to define routing and mediation rules in a variety of domain-specific languages (DSL, such as Java, XML, Groovy, Kotlin, and YAML).


2 Answers

I assume that you are talking about the ProcessorDefinition class.

The javadoc comments say to use the bean(...) methods as replacements for the beanRef(...) methods.

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

like image 163
Stephen C Avatar answered Oct 17 '22 11:10

Stephen C


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

OR

from(...).bean("beanId", "myMethod")
like image 23
Michael Dzuba Avatar answered Oct 17 '22 10:10

Michael Dzuba