Question

I am looking into ways to deploy and update an OSGI (Karaf, specifically) application. It seems that there are several options. One is to use The OSGi Bundle Repository (OBR), another is to use Features in Karaf, and the third is to use Karaf Cave.

I'm not really sure how these options are really different. They all seem to be doing the same things. Are they just different implementations of the same functionality? Could someone please explain the differences or provide some recommendations?

Was it helpful?

Solution

Karaf features and OBR are different ways of solving the (sort of) same problem. Both allow you to install OSGi bundles into an OSGi framework, but how they decide which bundles to install is different.

With a Karaf feature, you provide a file (feature.xml, say) which explicitly lists URLs for all the bundles for the feature. They can live on the filesystem, or in a maven repository, or anywhere else which can be described by a URL.

OBR, on the other hand, works out what bundles to work out based on requirements and capabilities. It will work out the transitive dependencies of whatever you're installing as your starting point and make sure they all get installed. Usually you'd configure one or more external repositories which support the OBR format, and then an OBR resolver in your runtime would provision bundles from those repositories. So you can say "I need package org.foo" or "I need an OSGi service which implements org.bar" and the provisioner will decide which bundles best suit your requirements. OBR is more flexible and generic than Karaf features, but it might be overkill if you're just installing a well-defined set of bundles into a framework which is already primed with the infrastructure you need. It also doesn't help you if the bundles which make up your application don't have dependencies on each other - you'll still need to include them all in your 'starting set'.

The distinction gets a bit blurred, because Karaf features allow you to specify version ranges in the maven URLs, so even with a feature you can be a bit flexible in what gets provisioned. Karaf features also have an interoperability with OBR so you can write your feature definition file in terms of OBR requirements.

I believe Karaf Cave is an OBR implementation with some feature-features. So it's a server rather than a new 'technology' like features or OBR provisioning.

-- Enterprise OSGi in Action: http://www.manning.com/cummins

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top