lunes, 6 de octubre de 2014

Summary of What is OSGi and why I should use it

Hi Devs !!!

Here we are on road again ....

Last  12th and 13th of September we had a great presentation about OSGi and Apache Karaf by Jean Baptiste Onofre.

He showed us the main purposes for this, relatively old, technology ( 1999 ) : OSGi, created by a group of great companies like IBM and Oracle, 

OSGi gives you the power to allow developing your applications with dynamic modularity to decouple and distribute them more easily.

In OSGi we build bundles ( jar files ), that are the minimum expression we deploy in our framework. Every bundle has its own classloader and they live in the same "universe" and can share services and consume them from other bundles with no effort.


Our bundles have their own lifecycle, and we can manage them installing, running, stopping and uninstalling without having to stop the other bundles or the framework.

One main feature of OSGi are the services. We can register our services ( some in every bundle ) as providers, and we can consume those services as consumers. The consumers simply injects the service but it doesn't know where exactly lives the service and which concrete implementation it would get. The contract is the interface.

One of the most popular OSGi frameworks is Apache Karaf, based on Apache Felix or Eclipse Equinox and including some useful utilities ( logging, shell, security, configAdmin, web container .... )
It provides us with a shell to execute the commands and also a web page to manage the framework.






We also had time to see what is Apache Cellar, a subproject of Apache Karaf that allows powerful synchronisation of multiple Karaf instances. It uses Hazelcast for data distribution.

With Cellar we can distribute our bundles in a mirror system to ease the scalability and we also can consume services from other framework instances without effort and as a single injection .




Here you have the slides ( we are improving the audio for the video presentation, any help ? ) :



Enjoy it !!!


No hay comentarios:

Publicar un comentario en la entrada