Code Monkey home page Code Monkey logo

camel-fuse-example-chapter-15's Introduction

Camel CBR Project

This project demonstrates the Camel Content Based Router (CBR) pattern in Apache Camel.

To build this project use

mvn install

To run this project use the following Maven goal

mvn camel:run

For more help see the Apache Camel documentation

http://camel.apache.org/

What is it?

This quick start shows how to use Apache Camel, and its OSGi integration to dynamically route messages to new or updated OSGi bundles. This allows you to route to newly deployed services at runtime without impacting running services.

This quick start combines use of the Camel Recipient List, which allows you to at runtime specify the Camel Endpoint to route to, and use of the Camel VM Component, which provides a SEDA queue that can be accessed from different OSGi bundles running in the same Java virtual machine.

In studying this quick start you will learn:

  • how to define a Camel route using the Blueprint XML syntax
  • how to build and deploy an OSGi bundle in Red Hat Fuse
  • how to use the CBR enterprise integration pattern

For more information see:

Note: Extra steps, like use of Camel VM Component, need to be taken when accessing Camel Routes in different Camel Contexts, and in different OSGi bundles, as you are dealing with classes in different ClassLoaders.

System requirements

Before building and running this quick start you need:

  • Maven 3.1.1 or higher
  • JDK 1.7 or 1.8
  • Red Hat Fuse 7

Build and Deploy the Quickstart

  1. Change your working directory to camel-fuse-example-chapter-15 directory.
  • Run mvn clean install to build the quickstart.

  • Start Red Hat Fuse by running bin/fuse (on Linux) or bin\fuse.bat (on Windows).

  • In the Red Hat Fuse console, enter the following command:

      osgi:install -s mvn:com.mycompany/camel-fuse-example-chapter-15/1.0.0-SNAPSHOT
    
  • Fuse should give you an id when the bundle is deployed

  • You can check that everything is ok by issuing the command:

      osgi:list
    

    your bundle should be present at the end of the list

Use the bundle

To use the application be sure to have deployed the quickstart in Fuse as described above.

  1. As soon as the Camel route has been started, you will see a directory work/cbr/input in your Red Hat Fuse installation.
  2. Copy the files you find in this quick start's src/test/resources/data directory to the newly created work/cbr/input directory.
  3. Wait a few moments and you will find the same files organized by country under the work/cbr/output directory.
  • order1.xml in work/cbr/output/others
  • order2.xml and order4.xml in work/cbr/output/uk
  • order3.xml and order5.xml in work/cbr/output/us
  1. Use log:display to check out the business logging. Receiving order order1.xml Sending order order1.xml to another country Done processing order1.xml

Undeploy the Archive

To stop and undeploy the bundle in Fuse:

  1. Enter osgi:list command to retrieve your bundle id

  2. To stop and uninstall the bundle enter

     osgi:uninstall <id>
    

camel-fuse-example-chapter-15's People

Contributors

malogan82 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.