This website and its associated repositories, are deprecated and no longer supported by the OSGi Alliance. Please visit https://enroute.osgi.org for the latest supported version of OSGi enRoute.
This enRoute v2 archive site is kept for those who do not intend to use the latest version of OSGi enRoute. If you are new to OSGi enRoute, then please start with the latest OSGi enRoute.
The purpose of this tutorial is to become familiar with distributed OSGi. In this tutorial you will design a simple Chat service that uses a service to represent a member in a chat group. Using Gogo shell commands we will play with this service locally. We will then export the Chat service and enable distributed OSGi so we can chat to members outside our framework. For this we need a Zookeeper server for discovering our peers. From within Bndtools we start a Zookeeper server for this purpose.
As bonus, we create a small Web application that acts as GUI.
A chat service like Skype, Facebook Messenger, WhatsApp, etc. It allows you to send a message to someone else and then that person can reply. The core problem is to find the communication endpoint on which our chat partner resides. This requires some kind of discovery process. Once we found the endpoint, we use some transport mechanism to send the message. This message then can contain our address so that the other side can respond using the same process.
In this example we use the OSGi service registry for the discover and transport. This works perfectly for local services but using distributed OSGi we can allow others on other computers to participate as well.