Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the asciidoc in the repository: https://github.com/apache/camel/blob/master/README.md https://github.com/apache/camel/blob/master/components/readme.adoc
Available as of Camel 2.12
This example is located in the
If you use maven then you can easily install the example from the command line:
This example shows how to exchange data using a shared database table.
The example has two Camel routes. The first route insert new data into the table, triggered by a timer to run every 5th second.
This example uses a bean to generate orders
And the CamelContext has two routes as shown below:
MyBatis mapping files
MyBatis allows to externalize the SQL queries and mapping from SQL to POJOs.
We have a plain POJO
And the MyBatis mapping file
Running the example
This example requires running in Apache Karaf / ServiceMix
To install Apache Camel in Karaf you type in the shell (we use version 2.12.0):
First you need to install the following features in Karaf/ServiceMix with:
Then you can install the Camel example:
And you can see the application running by tailing the logs
And you can use ctrl + c to stop tailing the log.
As of Camel 2.12.3 onwards
You can install and run this example using it's