Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

CXF DOSGi in Apache Karaf

Using the descriptions below a working demo should be up in less than 10 minutes.

Download and unpack Apache Karaf

Installation of CXF-DOSGi

Code Block
languagebash
feature:repo-add aries-rsa 1.9.0
feature:repo-add cxf-dosgi 1.8.0
feature:install cxf-dosgi-provider-cxf

Test installation with greeter demo

Code Block
languagebash
install -s
features:addurl mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-ri-samples-greeter-interface/1.4-SNAPSHOT/xml/features
features:8.0
install cxf-dosgi-discovery-distributed

...

-s mvn:org.apache.cxf.dosgi.

...

Code Block

zookeeper.port=2181
zookeeper.host=localhost

Installation of the zookeeper Server

Code Block

features:install cxf-dosgi-zookeeper-server
samples/cxf-dosgi-ri-samples-greeter-impl/1.8.0

endpoints should show the greeter service being exported:

Code Block
languagebash
Endpoints for framework 346376f5-ef56-4bda-b238-0a905ce99342
id                            | interfaces                                            | framework                            | comp name
----------------------------------------------------------------------------------------------------------------------------------------
http://localhost:9090/greeter | [

...

org.apache.cxf.dosgi.

...

samples.

...

greeter.GreeterService] | 346376f5-ef56-4bda-b238-0a905ce99342 |    

Now try to access the service using

http://localhost:9090/greeter

Access the service transparently from a second container

  • Unpack karaf in a second directory and also start it.
  • Do the installation steps from "Installation of CXF-DOSGi"
  • Install a client to a service that is published in the first container.
  • DOSGi will automatically install a proxy for you service that calls the published service remotely over CXF

 

...