What exactly is Apache Karaf?
Asked Answered
P

3

79

I am a little bit confused about what Apache Karaf exactly is.

Can you say that Apache Karaf includes, amongst other things:

  • Apache Felix (which is an implementation of the OSGi 4.2 framework)
  • Apache Aries (which is an implementation of the Blueprint standard)
Promulgate answered 27/6, 2013 at 18:7 Comment(3)
I've been working with OSGi for nearly ten years and I also don't get the point of Karaf ;-)Prenotion
Related question #1612620Ferdy
You can jump into it : youtu.be/hFgXPs251po?t=882Impersonalize
B
70

TLDR: Apache Karaf is much more 'batteries-included'. It can also run on any OSGI runtime.

Apache Felix (which is an implementation of the OSGi 4.2 framework)

Sort of. Apache Karaf can use Apache Felix. Apache Karaf can also use Equinox or another OSGi runtime. By default, the Apache Karaf standard download does come with Apache Felix.

Apache Aries (which is an implementation of the Blueprint standard)

Again, sort of. The standard download of Apache Karaf does come with Apache Aries by default.

Now let's talk about what OSGI (Apache Felix, Equinox) is and what Apache Karaf is:

OSGI is very simple. You can start an OSGI runtime in your application and not even notice it. The shell, the ability to hot deploy from a folder, install from a maven repo, etc..These are all extras that OSGI doesn't have to do and are provided by additional projects like Karaf, GOGO, or Pax

Now on to Apache Karaf:

It is basically an OSGI environment that provides some additional goodies on top of a standard OSGI implementation. Because Apache Karaf is just built on standard OSGI, it can in theory run on any OSGI runtime. This gives you a uniform interface for working with OSGI runtimes.

Some goodies Apache Karaf provides that you won't see in a Apache Felix without some additional work:

  • Folder based hot deployment
  • A (IMHO) better default console than gogo. (org.apache.karaf.shell)
  • Remote SSH access to that console. (org.apache.karaf.shell.ssh)
  • Centralized Logging System. (org.apache.karaf.log)
  • It has it's own way of provisioning bundles and start levels. (org.apache.karaf.features)
  • Karaf has it's own maven plugins as well.

Pretty much anything here:

http://mvnrepository.com/search.html?query=org.apache.karaf*

I mentioned Karaf having it's own way of provisioning bundles and start levels. Apache Karaf also comes with a bunch of pre-defined ones to get started with. I know Apache Felix comes with some as well, through OBR, but Apache Karaf comes much more 'batteries-included'.

Boyhood answered 28/6, 2013 at 15:57 Comment(0)
K
34

Apache Karaf is a swiss army knife to run OSGi "stuff" and non OSGi things bundled as OSGi.

Felix and Aries are default but the frameworks are pluggable, so equinox works as well.

  • "Unix like" shell accessible from CLI or SSH
  • Hotdeploy of bundles
  • May deploy almost anything as a bundle (plain .jar, spring xml, blueprint, etc)
  • WAR files
  • Deploy from maven - including autowrapping non OSGi bundles.
  • Web Console
  • Karaf features - ".kar files" that includes bundles and custom karaf features/commands.

A side note is that Karaf is part of ServiceMix (the initial name was ServiceMix kernel), so it has very tight integration with Apache Camel, Apache CXF and Apache ActiveMQ. Turning Karaf into an ESB with those features is trivial.

Krimmer answered 1/7, 2013 at 6:41 Comment(0)
T
2

Apache Karaf is just an OSGi framework (it can be equinox, felix .etc) with a bunch of predefined modules.

Apache Karaf architecture: apache karaf architecture

Tawanda answered 26/2, 2019 at 8:25 Comment(2)
Karaf is not an OSGi framework. It's a OSGi runtime environment. And I don't think 'a bunch of predefined modules' would be any helpful for people asking the question!Venditti
I think that the Apache Karaf Overview is clear. Apache Karaf is a set of bundles (modules), it includes an OSGi framework (a set of tools exported by the base osgi bundle -the core- in order to be used by other bundles)Tawanda

© 2022 - 2024 — McMap. All rights reserved.