Thanks for the answers and guidelines Claus. I looked into the ServiceMix, but the project seems so abandoned, I decided not to use it. I read some discussions on the user and dev lists which gave the impression that ServiceMix has no certain future. Plus, you are bound to use older versions of Karaf and other frameworks. My goal is also to use Apache Cellar as I want fail-over architecture for my routes. Also the documentation for ServiceMix is not very good.
One thing, is "Preparing Karaf for Camel" at http://camel.apache.org/karaf.html a necessary step - I mean putting modified config.properties in Karaf etc folder? I hope I will find the time today to try running some routes in the Karaf. Thanks, borut Dne 11. april 2012 09:05 je Claus Ibsen <claus.ib...@gmail.com> napisal/-a: > On Wed, Apr 11, 2012 at 8:32 AM, Borut Bolčina <borut.bolc...@gmail.com> > wrote: > > So instead of > > > > <dependency> > > <groupId>org.apache.camel</groupId> > > <artifactId>camel-core</artifactId> > > <version>${camel-version}</version> > > </dependency> > > > > I use camel-core-osgi and use the OsgiDefaultCamelContext instead and I > > should be safe? > > > > public void start(BundleContext context) throws Exception { > > camelContext = new OsgiDefaultCamelContext(context); > > ... > > } > > > > Yeah try that. > > > Will this enable me to use Camel commands in Karaf or will I have to use > > osgi:start command? > > > > You need to install the Camel Karaf commands, they come out of the box > if you install the camel feature. > > In Karaf 2.2.6 onwards its even easier to install Camel as you dont > have to remember a mvn url, as there is a new chooseurl command. > The name of that command IMHO could have been better, as now you have > features:addUrl and features:chooseUrl, and they kinda does the same. > > Anyway its something a like: > > features:chooseurl camel 2.9.1 > features:install camel > > See details here > http://camel.apache.org/karaf.html > > > if you use CXF in Karaf then there is a jre properties file you need > to replace. We put details in the Camel release notes in the bottom > http://camel.apache.org/camel-290-release.html > > The configuration files are in the etc directory. > > > A distribution like Apache ServiceMix got all the pre-setup out of the > box, as it include CXF, Camel, ActiveMQ, Karaf out of the box. > With a pure Karaf distribution you may have to tweak it. As Karaf is a > general purpose container. That can be used to build/brand as other > products. > > > > > Thanks, > > borut > > > > > > Dne 11. april 2012 05:51 je Claus Ibsen <claus.ib...@gmail.com> > napisal/-a: > > > >> Hi > >> > >> Yeah that is how this can be done with OSGi APIs. > >> > >> You may want to use the camel-core-osgi JAR and use the > >> OsgiDefaultCamelContext as the CamelContext instance. > >> That one knows about the OSGi runtime. Otherwise you may run in trouble. > >> > >> > >> On Tue, Apr 10, 2012 at 3:02 PM, Borut Bolčina <borut.bolc...@gmail.com > > > >> wrote: > >> > Hello, > >> > > >> > I was wondering if I am going down the right path. My goal is to > deploy a > >> > simple Camel route to an OSGI container, but without the Spring > "startup > >> > code". > >> > > >> > The route: > >> > > >> > public class WeatherCurrentRouteBuilder extends RouteBuilder { > >> > public void configure() { > >> > ... > >> > } > >> > } > >> > > >> > and to start and stop the route I implemented: > >> > > >> > public class WeatherCurrentBundleActivator implements BundleActivator > { > >> > > >> > CamelContext camelContext; > >> > > >> > public void start(BundleContext context) throws Exception { > >> > camelContext = new DefaultCamelContext(); > >> > > >> > PropertiesComponent pc = new PropertiesComponent(); > >> > pc.setLocation("classpath:weather.properties"); > >> > camelContext.addComponent("properties", pc); > >> > > >> > camelContext.addRoutes(new WeatherCurrentRouteBuilder()); > >> > > >> > camelContext.start(); > >> > > >> > } > >> > > >> > public void stop(BundleContext context) throws Exception { > >> > camelContext.stop(); > >> > } > >> > > >> > } > >> > > >> > I added the maven-bundle-plugin into my pom to build the osgi bundle. > >> > > >> > Is this the way to go? > >> > > >> > Cheers, > >> > borut > >> > >> > >> > >> -- > >> Claus Ibsen > >> ----------------- > >> CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com > >> FuseSource > >> Email: cib...@fusesource.com > >> Web: http://fusesource.com > >> Twitter: davsclaus, fusenews > >> Blog: http://davsclaus.blogspot.com/ > >> Author of Camel in Action: http://www.manning.com/ibsen/ > >> > > > > -- > Claus Ibsen > ----------------- > CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com > FuseSource > Email: cib...@fusesource.com > Web: http://fusesource.com > Twitter: davsclaus, fusenews > Blog: http://davsclaus.blogspot.com/ > Author of Camel in Action: http://www.manning.com/ibsen/ >