Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

OSGi toolchain from the ground up - Matteo Rulli


Published on

OSGi Community Event 2016 Presentation by Matteo Rulli (FlairBit)

OSGi learning curve is steep but its benefits widely surpass difficulties: OSGi gives you sensible dependencies management, pluggable extensions mechanisms, strong modularity, out-of-the-box semantic versioning support and strong contract-based software development.

In this talk I’ll describe how to build an effective OSGi toolchain from the ground up: integrate maven and bndtools, set-up a test-driven development workflow on top of OSGi, use maven repositories as a baseline for semantic versioning and leverage bnd remote launcher to effectively debug bundles on remote target runtimes.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

OSGi toolchain from the ground up - Matteo Rulli

  1. 1. OSGi toolchain from the ground up Matteo Rulli - FlairBit Do not duplicate or distribute without written permission from FlairBit S.r.l. FlairBit S.r.l. - Viale Brigate Bisagno 12/1 - 16129 Genova (GE) - ITALY
  2. 2. This Presentation • OSGi and IoT • Pure maven approach • Bndtools • Integrate complex runtimes in bndtools: CXF example • Remote debugging on external runtimes: Karaf
  3. 3. OSGi enRoute
  4. 4. OSGi and IoT • Isolated and loosely coupled services are more easily distributable across different execution contexts • A reasonable balance between hundreds-of- processes-μServices and old-fashioned monoliths • Services consistent versioning • Productivity and sensible code re-use
  5. 5. Pure maven approach • Let’s illustrate a trivial Cassandra Key-Value store implementation with bnd, maven and equinox…
  6. 6. Pure maven approach: projects • The key-value implemetation: API and provider • The GOGO command • Integration test • bndrun setting to resolve and launch
  7. 7. Bndtools Bndtools brings all bnd features inside the Eclipse IDE • Bundles Resolution • TDD with JUnit • Maven and OBR repo integration • SemVer support
  8. 8. Apache Karaf Curated OSGi runtime with • Bundles and applications deployment • Bundles Provisioning • Powerfull remote ssh and web OSGi console • Out-of-the-box OSGi support for many technologies (CXF, Camel, …) • Tons of other very useful features
  9. 9. Karaf Features in bndtools • Karaf Features:
  10. 10. CXF Karaf Features • Up to 110 bundles get installed automatically … manage them with a pom? Boring… But I want to debug my integration test in my IDE!
  11. 11. Karaf Features in bnd(tools) Karaf Feature Service is just an OSGi bundle with few dependencies: karaf@root>bundle:tree-show 26 Bundle org.apache.karaf.deployer.features [26] is currently ACTIVE org.apache.karaf.deployer.features [26] +- org.apache.felix.fileinstall [4] | +- org.apache.felix.configadmin [3] | | +- org.ops4j.pax.logging.pax-logging-api [1] | | +- [6] | | +- org.apache.felix.metatype [5] | +- org.ops4j.pax.logging.pax-logging-api [1] +- org.ops4j.pax.logging.pax-logging-api [1] +- org.apache.karaf.features.core [8] +- [6] +- org.apache.felix.configadmin [3] +- org.ops4j.pax.url.mvn [7] | +- org.apache.felix.configadmin [3] | +- org.ops4j.pax.logging.pax-logging-api [1] +- org.ops4j.pax.logging.pax-logging-api [1]
  12. 12. Karaf Features in bnd(tools) • So you can install Feature Service in any OSGi distro, not only within Karaf… …let’s see this in action.
  13. 13. Debug Karaf w/ bnd remote agents Requirements in Karaf for remote debugging w/ bnd: • mvn:biz.aQute.bnd/biz.aQute.remote.agent/3.3.0 • scr feature (just because we use DS in the demo)
  14. 14. Conclusions • Toolkits revolving around OSGi are more and more refined • Robustness of bnd and its derivative works is enterprise-grade • Thanks to OSGi modularity, interoperability among OSGi distros can be quite satisfactory • Thanks to OSGi enRoute initiative, OSGi is now extensively documented
  15. 15. Thanks! e-mail: web: