ServiceMix example project showing best practices
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

This project is an example of using OSGi, Camel, and JBoss Fuse together. A number of things are shown within this project:

  • use of the ActiveMQ and activemq-camel component for inter OSGi bundle communication
  • multiple front-end proxies (WS and batch file)
  • bridging one way (fire and forget) messaging with request-response
  • and much more...

The scenario is a payment transfer service where transfer requests can be made either through a WS (SOAP/HTTP) interface or through batch files.

This solution is a bit over-engineered, but the goal of this effort is to provide examples of best practices in creating applications using these technologies. Following is a brief overview of the included modules. Module Overview:

  • payment-service-shared: contains wsdl and generated JAXB artifacts, providing a common data model for data moving through the system
  • payment-service-bank: process the transfer request
  • payment-service-ws: SOAP/HTTP request-response proxy for transfer service
  • payment-service-batch: splits multiple requests within a file, and forwards them to the router. Adapts a one-way process (batch file) to a request-response service (transfer).


To run:

  1. Build this project so bundles are deployed into your local maven repo

    $ mvn clean install

  2. Start JBoss Fuse

(See the note about adding an admin user below)

<JBoss Fuse home> $ bin/fuse
  1. Add this projects features.xml config to JBoss Fuse from the Fuse Console (makes it easier to install bundles with all required dependencies)

    JBossFuse:karaf@root> features:addUrl mvn:org.fusesource.examples/payment-service-shared/1.4.0-SNAPSHOT/xml/features

  2. Install the bundles.

    Note: payment-service-shared gets installed by the other features.

    JBossFuse:karaf@root> features:install payment-service-bank JBossFuse:karaf@root> features:install payment-service-ws JBossFuse:karaf@root> features:install payment-service-batch

    there is also a shortcut features that installs all the others

    JBossFuse:karaf@root> features:install payment-service-all

  3. To test the batch file processing, there is an existing batch file in the payment-service-batch modules.

    Note: /tmp/file-in directory is created automatically by Camel within the payment-service-batch bundle.

    $ cp payment-service-batch/transfers.xml /tmp/file-in

    To see what happened look at the JBoss Fuse log file, either from the console

    JBossFuse:karaf@root> log:display

    or from the command line

    $ tail -f data/log/fuse.log

  4. To test the WS, use your favorite WS tool (e.g. SoapUI) against the following WSDLs hosted by the payment-service-ws bundle -- http://localhost:9090/paymentService?WSDL

    you can also the payment-service-client, which shows using CXF generated client code

    payment-service/payment-service-client> mvn -PPayment


  • if you see linkage errors related to javax.activation.DataHandler, you may need to edit JBoss Fuse's etc/ file, and add javax.activation to the list of packages exported by the base bundle by uncommenting (remote the leading '#') the javax.activation line.

    jre-1.7= \
    javax.accessibility, \
    javax.activation;version="1.1", \
    javax.activity, \

  • In JBoss Fuse, make sure that you've added a admin/admin userid and password to <JBoss Fuse Home>/etc/, or update the included Camel route to the userid and password you have defined for the JBoss Fuse embedded ActiveMQ.