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
Paul Bakker
June 24, 2015
Programming
310
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
790
RFC 193: OSGi CDI
paulbakker
2
540
Modularity in the Cloud: A PulseOn case study
paulbakker
0
230
Other Decks in Programming
See All in Programming
「人を評価する AI」の設計と実装
ryoyanara
0
230
運用ダッシュボードの設計を誰も教えてくれないのだけどみなさんどうしてるんですか? - チームに監視するという文化を根付かせるための第一歩を踏みたい -
satoshi256kbyte
1
140
不幸な GC
chencmd
0
670
My Marp Sample
sinoue0108
0
110
Claude Code全社展開のためにやったことn選~プラグイン302個・コミッター271人を支えるために~
kenchan
5
1.6k
in-process GraphQL のすすめ #ginzajs
izumin5210
4
1.5k
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
440
Android CLI
fornewid
0
230
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
370
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
240
AIに既存システムを理解させる技術 ~レガシーを見捨てないハーネスエンジニアリング入門~
ochtum
0
140
そこに3びきプロダクトがいるじゃろう——生成AI時代における“価値が届かない理由”の構造
kosuket
0
570
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
187
23k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
550
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
570
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Agile that works and the tools we love
rasmusluckow
331
22k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
280
Making the Leap to Tech Lead
cromwellryan
135
10k
Designing for Performance
lara
611
70k
Designing for humans not robots
tammielis
254
26k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
380
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