Show Table of Contents
Chapter 28. Ref
Overview
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
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;
XML example
For example, the splitter pattern can reference a custom expression using the Ref language, as follows:
<beans ...> <bean id="myExpression" class="com.mycompany.MyCustomExpression"/> ... <camelContext> <route> <from uri="seda:a"/> <split> <ref>myExpression</ref> <to uri="mock:b"/> </split> </route> </camelContext> </beans>
Java example
The preceding route can also be implemented in the Java DSL, as follows:
from("seda:a")
.split().ref("myExpression")
.to("seda:b");
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.