Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
Paul Bakker
June 24, 2015
Programming
2
300
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
Share
More Decks by Paul Bakker
See All by Paul Bakker
Kubernetes - Beyond the Basics
paulbakker
3
780
RFC 193: OSGi CDI
paulbakker
2
500
Modularity in the Cloud: A PulseOn case study
paulbakker
0
220
Other Decks in Programming
See All in Programming
愛される翻訳の秘訣
kishikawakatsumi
1
300
ローターアクトEクラブ アメリカンナイト:川端 柚菜 氏(Japan O.K. ローターアクトEクラブ 会長):2720 Japan O.K. ロータリーEクラブ2025年12月1日卓話
2720japanoke
0
720
Why Kotlin? 電子カルテを Kotlin で開発する理由 / Why Kotlin? at Henry
agatan
2
6.9k
AIコードレビューがチームの"文脈"を 読めるようになるまで
marutaku
0
350
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
6
920
モデル駆動設計をやってみようワークショップ開催報告(Modeling Forum2025) / model driven design workshop report
haru860
0
260
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
6
300
Microservices rules: What good looks like
cer
PRO
0
1.1k
開発に寄りそう自動テストの実現
goyoki
1
740
大体よく分かるscala.collection.immutable.HashMap ~ Compressed Hash-Array Mapped Prefix-tree (CHAMP) ~
matsu_chara
1
210
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
120
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.2k
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
[SF Ruby Conf 2025] Rails X
palkan
0
490
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
[RailsConf 2023] Rails as a piece of cake
palkan
58
6.1k
The Cult of Friendly URLs
andyhume
79
6.7k
Typedesign – Prime Four
hannesfritz
42
2.9k
Unsuck your backbone
ammeep
671
58k
What's in a price? How to price your products and services
michaelherold
246
12k
Leading Effective Engineering Teams in the AI Era
addyosmani
8
1.3k
GitHub's CSS Performance
jonrohan
1032
470k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
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