Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.Chapter 27. Ref
Overview Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
The Ref expression language is really just a way to look up a custom Expression from the Registry. This is particular convenient to use in the XML DSL.
The Ref language is part of
camel-core
.
Static import Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
To use the Ref language in your Java application code, include the following import statement in your Java source files:
import static org.apache.camel.language.simple.RefLanguage.ref;
import static org.apache.camel.language.simple.RefLanguage.ref;
XML example Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
For example, the splitter pattern can reference a custom expression using the Ref language, as follows:
Java example Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
The preceding route can also be implemented in the Java DSL, as follows:
from("seda:a") .split().ref("myExpression") .to("seda:b");
from("seda:a")
.split().ref("myExpression")
.to("seda:b");