OSGi: What are the differences between Apache Felix and Apache Karaf?
Asked Answered
C

3

143

Apache Karaf is a sub project of Apache Felix. It is defined as "a lightweight OSGi container".

I don't understand when should I use the heavyweight and when to use the lightweight. Their site doesn't explain this too much.

Cistern answered 23/10, 2009 at 8:37 Comment(0)
B
218

The 'lightweight OSGi container' label is contrasting Karaf with more feature rich OSGi containers, not with Felix.

To quote Guillaume Nodet (Karaf's author) from here:

Felix is just the OSGi core runtime. Karaf provides a "distribution" based on Felix by adding other features such as a console, an SSH remoting mechanism, a file deployer and more.

In this diagram of the Karaf architecture, Felix (or other OSGi implementation - currently Equinox is also supported) is the OSGi box, the other boxes are the features added by Karaf:

Karaf Architecture Therefore, unless you have specific needs which are not met by Karaf (requiring access to the underlying implementation) it usually makes sense to use this since it provides more 'out of the box'.

Brasher answered 23/10, 2009 at 13:1 Comment(3)
One nice feature of any OSGi container is that you can select just the bundles you need and deploy them into your container. So my advice would be to first architect your application, and then pick what you need. The advice to "just install the whole platform because it is feature rich" sounds a bit like going back to the huge Java EE application servers. Now I'm not saying that Apache Karaf is anywhere near as big as those, I am just making a point that you can and should just deploy what you actually need.Headwork
It seems to me this answer is incomplete in that it doesn't mention the use case of embedding Felix in an application (without the need for using a container such as Karaf) - for example to provide plugin capability - which is my interpretation of the following link. Am I wrong? (I'm no expert.) Link: felix.apache.org/documentation/subprojects/…Protocol
does Karaf use Felix or Equinox by default? thanksLeven
W
8

@Marcel Karaf isn't monolithic or huge like a Java EE server. It is a very slim and minimalist implementation. It is a core product without much functionality other than a basic console, file loading so that you can actually read configuration files, etc. The latest zip file of it is 19.1 MB. Yeah. Small. It can easily run on small devices and work in embedded.

What you may be thinking of is something more like ServiceMix which uses Karaf as a core/kernel. But it includes CXF, ActiveMQ, Camel and other libraries in its full configuration. Even then they have minimal, medium and full sizes.

Really, for 99% of the projects out there it wouldn't make sense to start directly with Felix and not use Karaf instead.

Wagram answered 3/3, 2016 at 17:2 Comment(0)
R
0

Currently, there are three popular open source OSGi containers:

  - Equinox. It is the modular Java runtime at the heart of the Eclipse IDE,
  - Knopflerfish, Is an open source implementation of the OSGi R3 and OSGi R4 specifications. 
  - Apache Felix. Is the open source OSGi container from the Apache Software Foundation.

http://www.javaworld.com/article/2077837/java-se/java-se-hello-osgi-part-1-bundles-for-beginners.html

The Apache project maintains a general-purpose OSGi container called Felix. Here is used as ServiceMix and

The main difference between the ServiceMix and Karaf is that ServiceMix bundles a bunch of other integration components — ActiveMQ message broker, the Camel routing engine, and some other things

According: http://kevinboone.net/osgitest.html

Rivalry answered 3/11, 2016 at 23:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.