pekko/akka-samples/akka-sample-osgi-dining-hakkers
2015-08-12 13:52:19 +02:00
..
api Merge pull request #2047 from drexin/wip-3858-make-case-classes-final-drexin 2014-03-11 16:06:31 +01:00
assembly-dist Security: use https to fetch repo artifacts. See http://blog.ontoillogical.com/blog/2014/07/28/how-to-take-over-any-java-developer/ 2014-08-19 07:21:14 -07:00
assembly-features =pro,sam,act Change version to 2.4-SNAPSHOT 2014-03-07 14:53:35 +01:00
command =pro,sam,act Change version to 2.4-SNAPSHOT 2014-03-07 14:53:35 +01:00
core !per #17862 Remove experimental from persistence 2015-08-12 13:52:19 +02:00
integration-test =pro,sam,act Change version to 2.4-SNAPSHOT 2014-03-07 14:53:35 +01:00
uncommons uncommons 1.2.2 depends on jfreechart 1.0.8 not present on maven central; see: 2014-11-28 13:50:17 -06:00
COPYING =sam #3887 Public domain license for activator templates 2014-02-21 12:31:00 +01:00
karaf.sh =pro,sam,act Change version to 2.4-SNAPSHOT 2014-03-07 14:53:35 +01:00
LICENSE =sam #3887 Public domain license for activator templates 2014-02-21 12:31:00 +01:00
pom.xml =pro #16695 Update dependencies 2015-05-19 08:37:54 +02:00
README.md akka.sample.osgi.dining-hakkers integration test 2013-03-01 21:49:50 +01:00

akka-osgi-sample : Clustered DiningHakkers

This project may be used to test akka bundles in OSGi Frameworks. The build tool (sbt for the moment) provide scripts to run in an OSGi Framework (Karaf only for the moment) a version of the DiningHakkers that runs on several nodes using the akka-cluster module.

Bundle overview

This project provides three Osgi Bundles

  • api providing an API for the Service exposed by the core and used by the command
  • core implementing the whole logic: clustered connections, Hakkers, ChopSticks. Finally it provides an ActorRef of one created Hakker
  • command use a service to get a Hakker (ActorRef) with its position around the table

An integration testing module is provided to verify OSGi functionality:

  • integration-test

Two modules that provision the project into the Karaf OSGi container for experimentation and integration testing:

  • assembly-features defines the karaf "feature" that allows Karaf to provision the bundles
  • assembly-dist creates a distribution tar.gz and zip file containing the configured Karaf runtime

How to use it

Setup with sbt

just run:

sbt clean
sbt package
sbt osgi-bundle

sbt will creates the bundles in each subproject akka-sample/akka-sample-osgi-dining-hakkers/(api, command, core)/target directories. To have integration tests and OSGi environment loaded, please use the Maven build (at least for the moment)

Setup with Maven

mvn clean install

The assembly-dist/target/ directory will now contain a tar.gz file that contains a pre-configured Karaf runtime. This can be extracted to any location, and bin/karaf executed. The provided karaf.sh script automates this.

Run

Extract the OSGi Framework from the tar.gz described above into any location, or run: ./karaf.sh

Execute the framework by running bin/karaf from inside the extracted directory.

Then try to restart some bundles, to test the stability of the bundles:

list to get the list of the bundles restart #bundle_number to restart the bundle using its ID exit or CTRL-D to exit the Karaf console

Depending on the akka version you're using, you may need to modify the core bundle when deploying on a second machine, to set its akka.remote.netty.hostname in the application.conf.