8.2. Routing with Apache Camel


  1. To route message fragments to Apache Camel endpoints, use the camel:route configuration from the http://www.milyn.org/xsd/smooks/camel-1.4.xsd configuration namespace.
  2. Route to a Camel endpoint by specifying the following in your Smooks configuration:
    <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
             xmlns:camel="http://www.milyn.org/xsd/smooks/camel-1.4.xsd">
     
      <!-- Create some bean instances from the input source... -->
      <jb:bean beanId="orderItem"  ... ">
        <!-- etc... See Smooks Java Binding docs -->
      </jb:bean>
     
      <!-- Route bean to camel endpoints... -->
      <camel:route beanId="orderItem">
        <camel:to endpoint="direct:slow" if="orderItem.priority == 'Normal'" />
        <camel:to endpoint="direct:express" if="orderItem.priority == 'High'" />
      </camel:route>
     
    </smooks-resource-list>
    
    
    In the above example, Javabeans is routed from the Smooks BeanContext to the Camel Endpoints. You can also apply templates (such as FreeMarker) to these same beans and route the templating result instead of the beans (such as as XML and CSV).
    routeOnElement.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

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.