{"id":352,"date":"2011-11-03T13:20:57","date_gmt":"2011-11-03T17:20:57","guid":{"rendered":"http:\/\/www.dankulp.com\/blog\/?p=352"},"modified":"2011-11-18T15:29:14","modified_gmt":"2011-11-18T19:29:14","slug":"apache-camel-in-osgi","status":"publish","type":"post","link":"https:\/\/www.dankulp.com\/blog\/?p=352","title":{"rendered":"Apache Camel in OSGi"},"content":{"rendered":"<p>After writing <a href=\"http:\/\/www.dankulp.com\/blog\/?p=332\">my post about setting up Apache CXF in OSGi<\/a>, I&#8217;ve had a couple people ask about how to do the same with <a href=\"http:\/\/camel.apache.org\">Apache Camel<\/a>.  Camel is a bit more complex due to all the libraries that it may pull in depending on which components you use, but it&#8217;s not really that much more complex.<\/p>\n<p>As with CXF, the easiest way to get it up and running would be to grab a distribution that has it ready to go.   Again, I&#8217;d recommend either the <a href=\"http:\/\/talend.com\/products\/tif\">Talend Integration Factory<\/a> or <a href=\"http:\/\/talend.com\/products\/esb\">Talend ESB<\/a>.   Both have <a href=\"http:\/\/camel.apache.org\">Apache Camel<\/a>, <a href=\"http:\/\/cxf.apache.org\">Apache CXF<\/a> and <a href=\"http:\/\/activemq.apache.org\">Apache ActiveMQ<\/a> pre setup to run and everything well configured.   The more popular Camel components are pre-installed with their dependencies making it fairly easy to get started.<\/p>\n<p>That said, setting up your own instance is really not that hard.  <\/p>\n<ol>\n<li>Follow steps 1-3 from <a href=\"http:\/\/www.dankulp.com\/blog\/?p=332\">my post about setting up Apache CXF in OSGi<\/a>.   This gets Karaf setup and ready.<\/li>\n<li>From the Karaf command line, run:\n<pre class=\"code\">\r\nfeatures:addurl mvn:org.apache.activemq\/activemq-karaf\/5.5.0\/xml\/features\r\nfeatures:addurl mvn:org.apache.cxf.karaf\/apache-cxf\/2.5.0\/xml\/features\r\nfeatures:addurl mvn:org.apache.camel.karaf\/apache-camel\/2.8.2\/xml\/features\r\n<\/pre>\n<p>That will add the ActiveMQ, CXF, and Camel features into Karafs feature resolver.\n<\/li>\n<li>If you plan on using JMS, it&#8217;s recommended to install the ActiveMQ features first.  From the Karaf command line, run:\n<pre class=\"code\">\r\nfeatures:install activemq\r\nfeatures:install activemq-spring    (if you use spring)\r\n<\/pre>\n<\/li>\n<li>Next up would be CXF if you plan on using the CXF components.  Again, from the Karaf command line, run:\n<pre class=\"code\">\r\nfeatures:install cxf\r\n<\/pre>\n<\/li>\n<li>Finally, install the Camel components you are interested in using:\n<pre class=\"code\">\r\nfeatures:install camel-core\r\nfeatures:install camel-spring\r\nfeatures:install camel-jms\r\nfeatures:install camel-cxf\r\netc...\r\n<\/pre>\n<p>You can get a list of the Camel features by doing a &#8220;features:list | grep camel&#8221; from the Karaf command line.\n<\/li>\n<\/ol>\n<p>That&#8217;s pretty much all there is to it.  It&#8217;s not hard.  \ud83d\ude42    It&#8217;s now all setup!   To try it out, I&#8217;d once again grabbing the samples package from <a href=\"http:\/\/talend.com\/products\/tif\">Talend Integration Factory<\/a>.   There are several examples in there on how to do various Camel things, all running in OSGi.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After writing my post about setting up Apache CXF in OSGi, I&#8217;ve had a couple people ask about how to do the same with Apache Camel. Camel is a bit more complex due to all the libraries that it may pull in depending on which components you use, but it&#8217;s not really that much more [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,9,13],"tags":[],"_links":{"self":[{"href":"https:\/\/www.dankulp.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/352"}],"collection":[{"href":"https:\/\/www.dankulp.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dankulp.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dankulp.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dankulp.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=352"}],"version-history":[{"count":8,"href":"https:\/\/www.dankulp.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/352\/revisions"}],"predecessor-version":[{"id":359,"href":"https:\/\/www.dankulp.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/352\/revisions\/359"}],"wp:attachment":[{"href":"https:\/\/www.dankulp.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dankulp.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dankulp.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}