OSGi – The µServices Kernel
A high level technical introduction to OSGi
Once upon a time in 1998 …
long before SOA …
A JSR was born …
8
the OSGi Service FrameworkService
Service
Service
Service
To prevent confusion, we coined
the term …
micro-service
micro-service
micro-service
they did it again …
µService
because we are worth it …
Let’s go back to the beginning
Modularity
• modules have a private space and share a public
space
• modules limit their visibility and exposure
• complexity ∷ parts2
A B
C D
Modularity
• modules have a private space and share a public
space
• modules limit their visibility and exposure
• complexity ∷ parts2
A B
C D
Pub
Modularity
• modules have a private space and share a public
space
• modules limit their visibility and exposure
• complexity ∷ parts2
A B
C D
Pub
SoftwareComplexity
Moving Parts
Modularity’s Secret
SoftwareComplexity
Moving Parts
Modularity’s Secret
SoftwareComplexity
Moving Parts
Modularity’s Secret
SoftwareComplexity
Moving Parts
Modularity’s Secret
A	

v1.0
C	

v1.1
B	

v2.3
Done?
Interfaces/API
User
Class
Implementer
Class
Interface
User
Class
Implementer
Class
Interface
Interfaces/API
package com.api package com.provider.implpackage com.consumer.impl
User
Class
Implementer
Class
Interface
Interfaces/API
package com.api package com.provider.implpackage com.consumer.impl
DocumentBuilderYour App Xerces
User
Class
Implementer
Class
Interface
Interfaces/API
package com.api package com.provider.implpackage com.consumer.impl
User
Class
Implementer
Class
Interface
Interfaces/API
package com.api package com.provider.implpackage com.consumer.impl
User
Class
Implementer
Class
Interface
Interfaces/API
package com.api package com.provider.implpackage com.consumer.impl
User
Class
Implementer
Class
Interface
private
Interfaces/API
Now what?
package com.api package com.provider.implpackage com.consumer.impl
package com.api package com.provider.implpackage com.consumer.impl
Listen
package com.api package com.provider.implpackage com.consumer.impl
Register
Listen
package com.api package com.provider.implpackage com.consumer.impl
Register
GetListen
An honest broker …
Overhead?
µService call ≡ Method call
µService ≡ object
Closer with less irritation …
.
.
REST
SOA
.
REST
SOA “MICRO
Service”
.
REST
SOA “MICRO
Service”
µservice
.
REST
OSGi
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
G
B
E
H
C
F
I
OSGi
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
B
E
H
C
F
I
Ba Bb
OSGi
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
F
I
B
Ba Bb
OSGi
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
F
I
Ba Bb
OSGi
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
F
I
Ba Bb
OSGi
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
F
I
Ba Bb
OSGi
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
D
A
G
E
H
C
F
I
Ba Bb
OSGi
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
D
A
G
E
H
C
FF
Ba Bb
OSGi
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
FF
Ba Bb
OSGi
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
FF
Ba Bb
D
A
G
E
H
C
F
Ba Bb
OSGi
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
FF
Ba Bb
OSGi
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
FF
I v2.0
Ba Bb
OSGi
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
FF
I v2.0
S;1.1.0
F
Ba Bb
OSGi
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
FF
I v2.0
S;1.1.0
F
Ba Bb
OSGi
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
FF
I v2.0
S;1.1.0
F
Ba Bb
OSGi
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
FF
I v2.0
S;1.1.0
F
REST
Service Patterns
• Factory
• Listener
• Discovery
• Distribution
• Dependencies
Service Patterns
• Factory
• Listener
• Discovery
• Distribution
• Dependencies
Service Patterns
• Factory
• Listener
• Discovery
• Distribution
• Dependencies
Service Patterns
• Factory
• Listener
• Discovery
• Distribution
• Dependencies
Service Patterns
• Factory
• Listener
• Discovery
• Distribution
• Dependencies
Service Patterns
• Factory
• Listener
• Discovery
• Distribution
• Dependencies
But OSGi is so complicated!
Sigh …
Complexity is in the eye of the
beholder
Complexity is in the eye of the
beholder
The right tool for the job …
meet
bnd(tools)
bnd(tools)
• DS Component Annotation support
• Access to maven central and more
• Based on Capability model
• Extensive debugging with dynamic updating
• Executable JARs
• Release tool with semantic versioning
• Baselining
• Integration with Continuous Integration
bnd(tools)
• DS Component Annotation support
• Access to maven central and more
• Based on Capability model
• Extensive debugging with dynamic updating
• Executable JARs
• Release tool with semantic versioning
• Baselining
• Integration with Continuous Integration
See
N
eil
B
ar
tlett’s
talk
o
n
B
n
d
to
o
ls
n
ext
OSGi enRoute
OSGi enRoute
costofchange
functionality
costofchange
functionality
dynamic
languages
costofchange
functionality
dynamic
languages
Java/OSGi
costofchange
functionality
dynamic
languages
Java/OSGi
In the end,
OSGi is inevitable …
OSGi Release 6
• June 2nd the OSGi Core Release 6 Specification received its final
approval and will be available this week to the public for downloading.
• http://www.osgi.org/Specifications/HomePage

• The OSGi Board of Directors also approved the publication of an Early
Draft Specification of OSGi Enterprise Release 6 for downloading.
• http://www.osgi.org/Specifications/Drafts

OSGi Release 6
• June 2nd the OSGi Core Release 6 Specification received its final
approval and will be available this week to the public for downloading.
• http://www.osgi.org/Specifications/HomePage

• The OSGi Board of Directors also approved the publication of an Early
Draft Specification of OSGi Enterprise Release 6 for downloading.
• http://www.osgi.org/Specifications/Drafts

NEW
Intro to OSGi – the Microservices kernel - P Kriens & T Ward

Intro to OSGi – the Microservices kernel - P Kriens & T Ward