23

Is anyone using Karaf instead of Servicemix? If so, how did you come to this decision? I'm aware that Servicemix adds a layer of functionality around Karaf, just curious if Karaf is being used on its own and why...

рüффп
  • 4,475
  • 34
  • 62
  • 99
Ben ODay
  • 19,926
  • 7
  • 41
  • 67

4 Answers4

27

We're using Karaf for a number of our applications. We were already using Camel (JMS and Esper) for integration between several different platforms (a JBoss 4.2 instance, a Tomcat and several Felix instances) and as this was working well there was little justification in migrating this too (which would have been cause to consider ServiceMix).

The only reason we have some Felix nodes, is that they're limited in use (on client desktops), rarely need/get updated and I wanted the smallest footprint for these nodes. For anything OSGi on the serverside we're using Karaf.

Karaf provides all of the features you'd expect and need for a production environment (see the apache-karaf tag's info). We do our development and testing against standard minimal framework (using pax-exam) but deploy to Karaf.

If you don't need an ESB, JCA, BPEL, etc but want a solid, tunable OSGi container, then Karaf on it's own is more than adequate. (And if you found yourself needing a limited subset of ServiceMix's functionality you can always install these in a Karaf instance).

You can also customise the Karaf distribution as part of a maven build - personally I like have the container as part of the application's build, as I can checkout, build and run the entire setup from the command line in minimal time.

Recently there's a clustering subproject of Karaf called Cellar using HazelCast, I not sure if this applies to ServiceMix too.

Renato
  • 10,539
  • 3
  • 43
  • 67
earcam
  • 6,522
  • 3
  • 33
  • 55
9

Karaf's life started as the ServiceMix core. Currently, ServiceMix is really a set of bundles that are deployed into a Karaf container. ServiceMix has a number of very handy bundles which do a lot of cool stuff that karaf doesn't. That said, the two primary reason for using ServiceMix is if you want: 1) an ESB, 2) NMR (a feature that allows you to community between bundles AND instances of Karaf).

This all said, the ServiceMix group is currently planning version 5, which will remove the ESB and NMR features and will be focused on being a management container for Camel. In ESB's a great deal of effort when into creating components that could be described using BPL (Business Process Language). However, the folks that wrote ServiceMix began to focus on the implementation of EIP's (Enterprise Integration Patterns) which largely does the same stuff as BPL, but does it in a more standardized and accepted manner. This work was done under the Camel project.

So, in short. If you are using ServiceMix 4+, you're also using Karaf. If you want a more robust integration environment, the environment of choice today (in the Apache/Felix world at least) is Karaf, Camel, and a few bundles from Servicemix.

Mike Van
  • 1,044
  • 7
  • 26
3

Here's a little comparative illustration I made. Going from the simplest case (JVM with OSGi functions provided by Apache Felix at the bottom), to more complete/manageable OSGi functions (Apache Karaf in the middle), to enough functions to implement complete ESB instances (Apache ServiceMix at the top) (note that "an ESB" is not a product but a set of endpoints, routers, databases, ETL functions and whatnot configured together in a particular task-specific way).

From Felix to Karaf to ServiceMix

David Tonhofer
  • 12,954
  • 4
  • 44
  • 46
  • It may be that some features previously available in Karaf have migrated down to Felix, the web description on this is hard to understand. – David Tonhofer Nov 29 '17 at 18:03
  • ...and will the future bring? [To ServiceMix or Not to ServiceMix](https://dzone.com/articles/servicemix-or-not-servicemix) – David Tonhofer Nov 30 '17 at 15:46
  • "Blueprint" is the [Apache Aries Blueprint](http://aries.apache.org/modules/blueprint.html), which is _dependency injection framework for OSGi and was standardized by the OSGi Alliance in OSGi Compendium R4.2._ (and apparently is based on the [Spring Dynamic Modules](https://docs.spring.io/osgi/docs/2.0.0.M1/reference/html/blueprint.html) implementation. However OSGi seems now very dead at Springsource: [Not a single Guide](https://spring.io/search?q=OSGi) in the search results. – David Tonhofer Nov 30 '17 at 18:54
0

Karaf does NOT come with CXF.

Its pure extracted kernel of ServiceMix. However, you can install CXF on Karaf as below.

karaf:root()> feature:repo:add cxf

Once the feature URL is added we can see the "provided" features by using the following command.

karaf:root()> feature:repo:feature:list | grep cxf

To install cxf fire the command below

karaf:root()> feature:install cxf

San
  • 1
  • 1