Home > Uncategorized > Running camel-tinkerforge on Karaf

Running camel-tinkerforge on Karaf

Running the Camel-Tinkerforge component is really easy on Karaf. The ready to go feature files make installation easy, and the use of the auto-deployment directory makes testing different route configurations also easy.

The camel-tinkerforge component is part of the Camel-labs IoT project. We just got started with this so the first release is still pending. This means you need to checkout the code from https://github.com/camel-labs/camel-labs and run “mvn install -DskipTests=true”. There’s no need to run the tests since the buildserver has already done that. 🙂

To intall Camel-Tinkerforge on Karaf 2.x run the following commands in the Shell:

features:chooseurl camel 2.15.2
features:install camel-blueprint

features:addurl mvn:com.github.camel-labs/camel-tinkerforge/0.0.0-SNAPSHOT/xml/features
features:install camel-tinkerforge

Now create a file with the following content:

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
            <from uri="tinkerforge:/temperature/T9"/>
            <to uri="log:default"/>

Run log:tail in the karaf Shell and copy the xml file to the deploy directory in the karaf installation directory. Notice how Karaf starts the camel routes defined in the xml file, and writes messages to the log whenever the temperature changes.

Now you can start experimenting with different routes in the xml file, and as soon as you save the file Karaf will automatically reload the routes.

Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: