You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

camel-jboss

Available as of Camel 2.1

The camel-jboss is a component which allows you to run Camel inside JBoss Application Server. This component is needed due JBoss classloading challenges.
The component is a specialized Camel Pluggable Class Resolvers to remedy this.

JBoss version

If you are using JBoss 5.x then you need to use camel-jboss JAR. If you are using JBoss 6.x then you need to use camel-jboss6 JAR.

The resolver is provided in the class org.apache.camel.jboss.JBossPackageScanClassResolver in the camel-jboss jar file.

Using with Java DSL

You need to configure the resolver on the CamelContext which is done like this:

  PackageScanClassResolver jbossResolver = new JBossPackageScanClassResolver();

  CamelContext context = new DefaultCamelContext();
  context.setPackageScanClassResolver(jbossResolver);

Using with Spring XML

When using Spring XML its just a matter of defining a spring bean with the JBoss class resolver as shown:

   <bean id="jbossResolver" class="org.apache.camel.jboss.JBossPackageScanClassResolver"/>

  <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
    <route>
      <from uri="seda:start"/>
      <to uri="mock:result"/>
    </route>
  </camelContext>

Dependencies

You need to get the component from the Camel Extra project as JBoss uses LPGL license which cannot be hosted at Apache.

  • No labels