Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
10 Reasons to use OSGi for your next cloud app
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Paul Bakker
June 24, 2015
Programming
300
2
Share
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
More Decks by Paul Bakker
See All by Paul Bakker
Kubernetes - Beyond the Basics
paulbakker
3
780
RFC 193: OSGi CDI
paulbakker
2
510
Modularity in the Cloud: A PulseOn case study
paulbakker
0
220
Other Decks in Programming
See All in Programming
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
180
AI 開発合宿を通して得た学び
niftycorp
PRO
0
180
AI活用のコスパを最大化する方法
ochtum
0
360
The free-lunch guide to idea circularity
hollycummins
0
390
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
580
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
420
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
480
Claude Code Skill入門
mayahoney
0
450
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
1.4k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
1.2k
ネイティブアプリとWebフロントエンドのAPI通信ラッパーにおける共通化の勘所
suguruooki
0
230
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
450
Featured
See All Featured
Balancing Empowerment & Direction
lara
5
1k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
1.9k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
Statistics for Hackers
jakevdp
799
230k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
120
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Mobile First: as difficult as doing things right
swwweet
225
10k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
68
38k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
310
Transcript
Ten reasons to use OSGi for your next cloud app
@pbakker
Paul Bakker @pbakker
Reason nr Developer Productivity 1
Code Maven build full project Deploy to app server Re-initialize
full app Typical Java development workflow…
Typical OSGi development workflow… “Like working with a scripting language”
None
How does it work? Class loader per bundle OSGi supports
updating a bundle On compile, bundle is rebuild and re-installed
Reason nr No more ClassNotFoundException 2
Imports / Exports OSGi bundles define explicitly what classes they
import Imports must be exported by some bundle Imports are calculated from your byte code
Example code z
Import packages are generated Import-‐Package: org.apache.felix.dm;version=“[4.0,5)", org.osgi.framework;version="[1.3,2)"
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…
API versioning Deploy multiple versions of an API Import a
specific version range Semantic Versioning
Reason nr Great for Cloud Deployment 3
Great for (Cloud) deployment No application server Executable JAR file
Very small memory footprint Perfect for building Docker containers
Building a binary gradle build export java -‐jar MyApp.jar
Dockerfile FROM jeanblanchard/busybox-‐java:8 COPY release/myapp.jar /app/myapp.jar WORKDIR /app
EXPOSE 8080 CMD java -‐jar myapp.jar
Great commercial support RTI Kubernetes based clusters Logging and Monitoring
for OSGi Automated Blue/Green deployments
Reason nr Maintainable architecture 4
Maintainable architecture Implementation hiding Enforce module boundaries Modules during development,
build and runtime
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
Data Business UI Big ball of mud Big ball of
mud Big ball of mud
Data Business UI
Rooms Resource AngularJS Client Rooms Service RabbitMQ Service STOMP AMQP
RabbitMQ Chat Log Mongose Jongo REST Personalized Ad Generator Word Counter Product Service MySQL
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
Reason nr Dependency Injection 5 @ServiceDependency
Register Demo component Inject dependency Lifecycle methods
Reason nr The road to Micro Services 6
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
OSGi Remote Services OSGi spec for remote service discovery and
invocation Pluggable discovery and transport No code changes required!
Client Server
Reason nr All the libraries you need 7
REST Scheduling Mongo JPA Web Resources Blob Stores Remote Services
Security Email Config Components No core framework or half a zillion dependencies!
Amdatu REST example
Amdatu Mongo example Amdatu Mongo Service Setup Object Mapper Execute
query
Reason nr Plugin systems 8 Plugin Registry Plugin Plugin Plugin
core.jar myplugin.jar Install plugin by installing a bundle
Real world examples Amdatu Bootstrap (even directly from Git repos)
Spring Roo Eclipse Glassfish …
Reason nr Integration testing 9
Integration testing Looks like plain JUnit Runs in an OSGi
framework
Reason nr Great resources to get you started 10
Don’t be afraid to ask! http://amdatu.org @pbakker