Question

I have run and tweaked the apache camel's built in example named "camel-example-sql" (..\apache-camel-2.11.0\examples\camel-example-sql) by running "mvn compile" and "mvn camel:run" as it is suggested and it works great. Now I want to run the same example in apache karaf. What should I do in simple steps?

Was it helpful?

Solution

I have updated the instructions for the example in the upcoming Apache Camel 2.12 release with instructions how to install in Karaf / ServiceMix as follows. This should work for 2.11.0 also:

Apache Karaf / ServiceMix

You will need to compile this example first: mvn compile

To install Apache Camel in Karaf you type in the shell (we use version 2.12.0):

  • features:chooseurl camel 2.12.0
  • features:install camel

First you need to install the following features in Karaf/ServiceMix with:

  • features:install camel-sql

Then you need to install JDBC connection pool and the Derby Database:

  • osgi:install -s mvn:commons-pool/commons-pool/1.6
  • osgi:install -s mvn:commons-dbcp/commons-dbcp/1.4
  • osgi:install -s mvn:org.apache.derby/derby/10.10.1.1

Then you can install the Camel example:

  • osgi:install -s mvn:org.apache.camel/camel-example-sql/2.12.0

And you can see the application running by tailing the logs

  • log:tail

OTHER TIPS

see this guide for general installation/configuration of Camel in Karaf: http://camel.apache.org/karaf.html

otherwise, the camel-example-sql does build an OSGI bundle and can be installed using the following:

osgi:install -s mvn:org.apache.camel/camel-example-sql/2.11.0

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top