Introducing Dynamic Discovery into OSGi distributed applications

This post is the second post of the dynamokos series. It improves the application made in the first post by adding dynamic remote service discovery.

In this post

The former post ends with an issue. The application behave strangely when the oracle is stopped. In this post, we start to fix the issue. To achieve that, I describe how to use a discovery protocol in order to avoid to statically import the service. We will see:

  • How A discovery service works
  • How we can use Zookeeper as a discovery protocol
  • How to publish a service on Zookeeper
  • How to discover a remote service using Zookeeper

Continue reading

Distributed OSGi applications with Apache CXF DOSGi

This is the first post of the Dynamokos series. This series explores how to build dynamic distributed web applications with OSGi step by step.

Inside this post

In this post, we will show how to:

  1. Use Apache CXF DOSGi to expose an OSGi service as a web service
  2. Use Apache CXF DOSGi to import the remote service in another OSGi framework
  3. Consume the imported service

The code of the post is available from the Dynamokos Google Project.
This post is very similar to the iPOJO / DOSGi tutorial.
Continue reading

Dynamokos : Dealing with dynamism in OSGi distributed web applications

Dynamokos is not a Greek specialty. It’s the name of this post series. Dynamokos aims to illustrate how OSGi can be used for distributed dynamic web applications.

OSGi offers great features such as the modularity, dynamism, hot-deployment… However, it is not simplex to know how to build sophisticated applications on the top of OSGi. Especially when such application needs to be distributed and dynamic at the same time, a lot of issues have to be overcome.

Throughout a simple application, this series explores how to build dynamic distributed web application on the top of OSGi.

Dynamokos Overview

Four posts compose this series:

  1. The first post shows how to expose an OSGi service as a web service with OSGi Distributed Service (Apache CXF DOSGi), and how to use this service. In this version the client knows where is the oracle.
  2. The second post modifies the first example to use a discovery protocol (to find the remote oracle. The web site is modified in order to basically manage the dynamism
  3. The third post explores the possibilities to mange the dynamism in the web page. This includes auto-refresh, Ajax and Cometd.
  4. Finally, the last post illustrates how OW2 Chameleon Rose (Remote OSGi Service Ecosystem) may replace DOSGi and the flexibility brings by this wonderful framework.

Continue reading