Upload
mfrancis
View
171
Download
1
Embed Size (px)
Citation preview
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
This Presentation• OSGi and IoT• Pure maven approach• Bndtools• Integrate complex runtimes in bndtools: CXF example• Remote debugging on external runtimes: Karaf
OSGi enRoute
http://enroute.osgi.org/
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
Pure maven approach• Let’s illustrate a trivial Cassandra Key-Value store
implementation with bnd, maven and equinox…
https://github.com/mrulli/com.flairbit.eclipsecon.onesix.git
Pure maven approach: projects• The key-value implemetation: API and provider• The GOGO command• Integration test
• bndrun setting to resolve and launch
BndtoolsBndtools brings all bnd features inside the Eclipse IDE
• Bundles Resolution• TDD with JUnit• Maven and OBR repo integration• SemVer support
Apache KarafCurated 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
Karaf Features in bndtools• Karaf Features:
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!
Karaf Features in bnd(tools)Karaf Feature Service is just an OSGi bundle with few dependencies:
karaf@root>bundle:tree-show 26Bundle org.apache.karaf.deployer.features [26] is currently ACTIVEorg.apache.karaf.deployer.features [26]+- org.apache.felix.fileinstall [4]| +- org.apache.felix.configadmin [3]| | +- org.ops4j.pax.logging.pax-logging-api [1]| | +- org.apache.karaf.services.eventadmin [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]
+- org.apache.karaf.services.eventadmin [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]
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.
Debug Karaf w/ bnd remote agentsRequirements 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)
https://github.com/mrulli/com.flairbit.examples.karaf-debughttp://enroute.osgi.org/appnotes/bndtools-and-karaf.html
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
Thanks!
e-mail: [email protected]: flairbit.com