Upgrade to Pro — share decks privately, control downloads, hide ads and more …

10 Reasons to use OSGi for your next cloud app

10 Reasons to use OSGi for your next cloud app

Learn why OSGi is a super productive technology to build modern (web) applications.

Paul Bakker

June 24, 2015
Tweet

More Decks by Paul Bakker

Other Decks in Programming

Transcript

  1. Code Maven build full project Deploy to app server Re-initialize

    full app Typical Java development workflow…
  2. How does it work? Class loader per bundle OSGi supports

    updating a bundle On compile, bundle is rebuild and re-installed
  3. Imports / Exports OSGi bundles define explicitly what classes they

    import Imports must be exported by some bundle Imports are calculated from your byte code
  4. The framework tells you what’s missing Unable to resolve 1.0:

    missing requirement [1.0] osgi.wiring.package; (&(osgi.wiring.package=org.apache.felix.dm) (version>=4.0.0)(!(version>=5.0.0))) Forgot  to  install  Dependency   Manager  bundle…
  5. API versioning Deploy multiple versions of an API Import a

    specific version range Semantic Versioning
  6. Great for (Cloud) deployment No application server Executable JAR file

    Very small memory footprint Perfect for building Docker containers
  7. Bundles and services Only APIs are exported, the bundle’s contract

    Services provide functionality True decoupling Service Registry Bundle registering a service Bundle using a service Publish MyInterface Lookup MyInterface
  8. Rooms Resource AngularJS Client Rooms Service RabbitMQ Service STOMP AMQP

    RabbitMQ Chat Log Mongose Jongo REST Personalized Ad Generator Word Counter Product Service MySQL
  9. Rooms Resource AngularJS Client Rooms Service RabbitMQ Service STOMP AMQP

    RabbitMQ Chat Log Mongo Jongo REST Personalized Ad Generator Word Counter Product Service MySQL Each part is a separate OSGi bundle
  10. Best preparation for Micro Services OSGi services are micro services

    within a VM Easy to migrate to remote services when needed Perfect balance between “Monolith First” and Micro Services from te get go
  11. OSGi Remote Services OSGi spec for remote service discovery and

    invocation Pluggable discovery and transport No code changes required!
  12. REST Scheduling Mongo JPA Web Resources Blob Stores Remote Services

    Security Email Config Components No core framework or half a zillion dependencies!