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
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:
- Use Apache CXF DOSGi to expose an OSGi service as a web service
- Use Apache CXF DOSGi to import the remote service in another OSGi framework
- 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.
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.
Four posts compose this series:
- 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.
- 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
- The third post explores the possibilities to mange the dynamism in the web page. This includes auto-refresh, Ajax and Cometd.
- Finally, the last post illustrates how OW2 Chameleon Rose (Remote OSGi Service Ecosystem) may replace DOSGi and the flexibility brings by this wonderful framework.