Chapter 27. Ref

download PDF


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"/>
      <from uri="seda:a"/>
        <to uri="mock:b"/>

Java example

The preceding route can also be implemented in the Java DSL, as follows:
Red Hat logoGithubRedditYoutubeTwitter


Try, buy, & sell


About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.