This is really easy and assumes that you've already set up your Eclipse workspace as described here.

Creating a Distributed OSGi Service

1. Create a new Plugin Project for a 'standard' OSGi Framework.

2. Create an OSGi service and and register it with the OSGi Service Registry. I'm creating a service that implements my test.distributed.service.TemperatureService.

The service is registered with the OSGi Service Registry in the Activator.

The only thing you need to do to expose a service remotely is setting the osgi.remote.interfaces property to the (comma separated) list of interfaces of the service that need to be exposed. Specifying * simply takes all the interfaces that were passed in to the registerService() call.
By default the service will be made available on http://{machine}:9000/fully/qualified/ClassName (so in this case http://localhost:9000/test/distributed/service/TemperatureService). You can change this by adding the osgi.remote.configuration.type and osgi.remote.configuration.pojo.address properties on the service, e.g.:

The Consumer Side

Developing the consumer side bundles requires no different setup than the server side bundles.

If you are using a OSGI-INF/remote-service/remote-services.xml file to statically configure the client side with the remote service, you will need to include this in your build.properties file to ensure that Eclipse puts it in your bundle. If you are using Discovery, this change to the build.properties is not needed.

See the samples/greeter demo for a full example.