Simplify maven deps by using inheritance Define dependency versions once in dependencyManagement and inherit in child modules, to avoid defining the version and scope of modules more than once. Use version properties to make things even clearer. Move the maven-bundle-plugin to the root of the project to avoid repeating the same config. Move the src/main/scala source configuration into the root by using the build-helper-plugin. Add a note in uncommons-maths OSGi build POM about v1.2.3 Resolve maven warnings about deprecations and missing versions Use maven-accessible sigar dependency Provision Karaf via maven and features Created assembly-features to define the project features for Karaf provisioning. Created assembly-dist containing the build instructions necessary to build an archive of a pre-configured Karaf instance. Update the Netty version. Use the pre-bundled Protobuf from the servicemix project -- see the features.xml created for Karaf -- and remove the manual protobuf bundling. |
||
|---|---|---|
| akka-actor/src/main | ||
| akka-actor-tests/src/test | ||
| akka-agent/src | ||
| akka-camel/src | ||
| akka-channels/src/main/scala/akka/channels | ||
| akka-channels-tests/src | ||
| akka-cluster/src | ||
| akka-contrib | ||
| akka-dataflow/src | ||
| akka-docs | ||
| akka-durable-mailboxes | ||
| akka-kernel/src/main | ||
| akka-multi-node-testkit/src/main | ||
| akka-osgi/src | ||
| akka-osgi-aries/src | ||
| akka-remote/src | ||
| akka-remote-tests/src | ||
| akka-samples | ||
| akka-sbt-plugin | ||
| akka-slf4j/src | ||
| akka-testkit/src | ||
| akka-transactor/src | ||
| akka-zeromq/src | ||
| api | ||
| assembly-dist | ||
| assembly-features | ||
| command | ||
| core | ||
| project | ||
| scripts | ||
| src/main/ls | ||
| uncommons | ||
| .gitignore | ||
| CONTRIBUTING.md | ||
| karaf.sh | ||
| LICENSE | ||
| osgi-run.sh | ||
| pom.xml | ||
| README.md | ||
| README.textile | ||
akka-osgi-sample : Clustered DiningHakker
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 unsing 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. It finally provide an ActorRef of one created Hakker
- command use a service to get a Hakker (ActorRef) with its position around the table
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 -- TODO update this for latest Karaf provisioning changes and other Maven build changes
just run:
sbt clean
sbt package
sbt osgi-bundle
sbt osgi-prepare
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 it's akka.remote.netty.hostname in the application.conf.
TODO: The VM ips below are specific to one environment, make this more general
The configuration is set to start the fist node on localhost, and to start other nodes on vm running on the same machine for tests (localhost and first vm ip would be 192.168.229.128, but it may differ according to your configuration.