SlideShare una empresa de Scribd logo
1 de 54
Descargar para leer sin conexión
Is OSGi Modularity
Always Worth It?
Glyn Normington
Agenda
• Costs and benefits
• Case studies
• When is OSGi worth it?
OSGi Benefits
✓Encapsulated module internals
✓Easier to understand, maintain, and extend
✓Explicit, versioned dependencies
✓Simplified impact analysis
✓Faster class loading
✓Visible architecture
✓bundles, services, dependencies
✓execution environment
OSGi Benefits
✓Side-by-side versioning
✓Dynamism
✓Loose coupling via services
OSGi Costs
Learning: OSGi, new runtime, new tools
Reusing 3rd party JARs
Designing appropriate bundles and services
Defining and upgrading dependencies
Building bundles
Debugging resolution failures and class loading
Coping with dynamism
vert.x Case Study
vert.x
• Asynchronous, event-driven web apps
• HTTP, WebSockets, sockjs
• Apps in Java, Groovy, JavaScript, Ruby
•Apps need not be thread safe
• JSON event bus
class loaderclass loader
server
verticle busmod
event bus
JSON JSON
client
vert.x
HTTP, WebSockets, sockjs
modulemodule
Converting vert.x to OSGi
• Convert vert.x runtime to bundles
• Convert verticles to bundles
• (Convert busmods to bundles - similarly)
Convert Runtime to Bundles
• JARs:
• vert.x core
• Netty - network IO
• Jackson & Jackson Mapper - JSON
Approach
• Eye-ball existing OSGi manifests
• Generate manifests where necessary
• Use bnd orVirgo bundlor
• Create a manifest template
• Test resolution
Existing OSGi Manifests
✓Netty
• Bundle version 3.4.2.Final
✓Jackson & Jackson Mapper
• Bundle version 1.9.4
Bundle vert.x core
• Use bnd orVirgo bundlor
• Manifest template required ...
vert.x Core Template
• vert.x name and version
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.vertx.core
Bundle-Name: vert.x Core
Bundle-Version: 1.0.0.final
Export-Template: *;version="1.0.0.final"
vert.x Core Template
• Package import template version ranges
• Netty: [3.4.2.Final, 4.0)
• Jackson: [1.9.4, 2.0)
• Other optional imports: 0
• 0 means [0, ∞)
• Package import version ranges
• Netty: [3.4.2.Final, 4.0)
• Jackson: [1.9.4, 2.0)
• Other optional imports: 0
• 0 means [0, ∞)
vert.x Core Template
Where did these
come from?
Version Ranges
• Lower bound
• What did you test?
• What old versions do you support?
• Upper bound
• Exporter’s versioning policy?
• How easy is it to change your bundle?
• Lifespan?
• Distribution?
NettyVersion Range
[3.4.2.Final, 3.5)[3.4.2.Final, 4.0)
Generate Bundle
bundlor.sh -i vert.x-core.jar
-m vertx.core.mf
-o vert.x-core-1.0.0.final.jar
Test Metadata
• UsingVirgo, for simplicity
• Place dependencies in repository/usr
• Place vert.x core in pickup
• StartVirgo:
...
<DE0005I> Started bundle 'org.vertx.core' version '1.0.0.final'.
ModularVerticles
public class MyVerticle extends Verticle {
public void start() {
vertx.createHttpServer().requestHandler(
new Handler<HttpServerRequest>() {
public void handle(HttpServerRequest req) {
...
}
}
).listen(8080);
}
}
public class MyVerticle extends Verticle {
public void start() {
vertx.createHttpServer().requestHandler(
new Handler<HttpServerRequest>() {
public void handle(HttpServerRequest req) {
...
}
}
).listen(8080);
}
}
public class MyVerticle extends Verticle {
public void start() {
vertx.createHttpServer().requestHandler(
new Handler<HttpServerRequest>() {
public void handle(HttpServerRequest req) {
...
}
}
).listen(8080);
}
}
redundant boilerplate
public class MyVerticle extends Verticle {
public void start() {
vertx.createHttpServer().requestHandler(
new Handler<HttpServerRequest>() {
public void handle(HttpServerRequest req) {
...
}
}
).listen(8080);
}
}
redundant boilerplate
not easily unit tested
public class MyVerticle extends Verticle {
public void start() {
vertx.createHttpServer().requestHandler(
new Handler<HttpServerRequest>() {
public void handle(HttpServerRequest req) {
...
}
}
).listen(8080);
}
}
baked-in configuration
redundant boilerplate
not easily unit tested
ModularVerticle
• Move boilerplate code to a support bundle
• Convert configuration to declarative
metadata
• Use services for loose coupling
• whiteboard pattern
public class MyHandler implements
Handler<HttpServerRequest> {
public void handle(HttpServerRequest req) {
...
}
}
<?xml version="1.0" encoding="UTF-8"?>
<blueprint
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<bean class="org.vertx.osgi.sample.MyHandler"
id="handler"/>
<service interface="org.vertx.java.core.Handler"
ref="handler">
<service-properties>
<entry key="type"
value="HttpServerRequestHandler">
<entry key="port" value="8080">
</service-properties>
</service>
</blueprint>
org.vertx.core
bundle
modular
verticle
bundle
org.vertx.osgi
bundle
OSGi Service Registry
2. publish handler
3. listen for/find handler
4. create server
5 register handler
6. set server listening
7. request from network
8. Handler.handle()9. HttpServerRequest operations
blueprint
service
1. listen for/find bundle
Was it worth it?
Benefits
✓vertx implementation can be hidden
✓Boilerplate factored out
✓Unit testing simplified
✓Configuration externalised
Costs
Deciding dependency version ranges
Reworking vert.x to improve encapsulation
Programming model changed
Shared dependencies must be thread safe
Costs
Deciding dependency version ranges
Reworking vert.x to improve encapsulation
Programming model changed
Shared dependencies must be thread safe
Conclusion: probably not worth it
vSphere Web Client
Case Study
vSphere Web Client
• OSGi based web server
• Virgo Server for Apache Tomcat
• Plugins allow users to extend the Web Client
• Custom data
• Custom relationships (for new/existing data)
browser
Virgo
(vSphere
Web Client)
vCenter Server
Flex UI
component
Data
Service
VMware
Inventory
Service
ESX
Server
ESX
Server
ESX
Server
VMVMVM
BlazeDS
browser
Virgo
(vSphere
Web Client)
vCenter Server
Flex UI
component
Data
Service
VMware
Inventory
Service
Remote Data
Source
Custom Flex UI
component
Custom Data
Service
ESX
Server
ESX
Server
ESX
Server
VMVMVM
plugin zip
plugin zip
plugin zip
BlazeDS BlazeDS
Was it worth it?
Benefits
✓Modular
✓Extensible by users
✓Internals not accessible to users
✓Dynamically updateable
Costs
Steep initial learning curve
Investment required inVirgo tooling
OSGi exposed to users
Costs
Steep initial learning curve
Investment required inVirgo tooling
OSGi exposed to users
Conclusion: worth it
Croatian Telecom
Case Study
Overview
• Virgo 3.0.3, EclipseLink,Atomikos,
ActiveMQ,Tomcat clustering, Hazelcast
• In production for more than a year
• last 7 months as a cluster
• Nearly 1 million user accounts
• 100s of web requests per second, peak
• Only one major outage, due to a Linux bug
Cited Benefits
✓Better understand components you use
✓Cleaner, higher quality code
✓Better system architecture
✓Reusable modules
Cited Costs
Time to learn the intricacies of OSGi
Time to integrate non-OSGi ready
components
Cited Costs
Time to learn the intricacies of OSGi
Time to integrate non-OSGi ready
components
Conclusion: worth it
Wrap-up
OSGi Costs
Learning: OSGi, new runtime, new tools
Reusing 3rd party JARs
Designing appropriate bundles and services
Defining and upgrading dependencies
Building bundles
Debugging resolution failures and class loading
Coping with dynamism
Reduced isolation in some cases
Further investment in tooling required
OSGi Benefits
✓Encapsulated module internals
✓Explicit, versioned dependencies
✓Side-by-side versioning
✓Dynamism
✓Visible architecture
✓Loose coupling via services
✓Better understanding of components
used
✓Reusable modules
When is OSGi worth it?
✓Lower layers benefit most
✓Control dependencies
✓Hide internals
Lower layers push higher layers to OSGi
? Exposing OSGi to users
✓Long-lived or critical applications
PRO TANTO QUID RETRIBUAMUS
For so much, what shall we give in return?
(wording from the edge of the Belfast £1 coin)
Further Information
• “Java Application Architecture” by Kirk
Knoernschild
• http://www.osgi.org
• http://underlap.blogspot.co.uk/2012/06/osgi-
case-study-modular-vertx.html
• http://vertx.io/
• http://underlap.blogspot.co.uk/2012/10/
virgo-in-vsphere.html
• http://www.osgi.org/wiki/uploads/Links/
SemanticVersioning.pdf
Credits
• “Coins” by Rob Redwood
• “Benefits of using OSGi”
http://www.osgi.org/Technology/WhyOSGi
• “One Pound” by Leo Reynolds

Más contenido relacionado

La actualidad más candente

Successfully Deliver and Operate OpenStack in Production with VMware VIO
Successfully Deliver and Operate OpenStack in Production with VMware VIOSuccessfully Deliver and Operate OpenStack in Production with VMware VIO
Successfully Deliver and Operate OpenStack in Production with VMware VIO
Arraya Solutions
 
W jak sposób architektura hipekonwergentna cisco simplivity usprawni działani...
W jak sposób architektura hipekonwergentna cisco simplivity usprawni działani...W jak sposób architektura hipekonwergentna cisco simplivity usprawni działani...
W jak sposób architektura hipekonwergentna cisco simplivity usprawni działani...
Pawel Serwan
 
VMUG22 Filip Verloy VIO
VMUG22 Filip Verloy VIOVMUG22 Filip Verloy VIO
VMUG22 Filip Verloy VIO
Filip Verloy
 
CloudStack vs OpenStack vs Eucalyptus: IaaS Private Cloud Brief Comparison
CloudStack vs OpenStack vs Eucalyptus: IaaS Private Cloud Brief ComparisonCloudStack vs OpenStack vs Eucalyptus: IaaS Private Cloud Brief Comparison
CloudStack vs OpenStack vs Eucalyptus: IaaS Private Cloud Brief Comparison
bizalgo
 
VIO30 Technical Overview
VIO30 Technical OverviewVIO30 Technical Overview
VIO30 Technical Overview
Julienne Pham
 
Turning OpenStack Swift into a VM storage platform
Turning OpenStack Swift into a VM storage platformTurning OpenStack Swift into a VM storage platform
Turning OpenStack Swift into a VM storage platform
OpenStack_Online
 

La actualidad más candente (20)

Hypervisor Capabilities in Apache CloudStack 4.3
Hypervisor Capabilities in Apache CloudStack 4.3Hypervisor Capabilities in Apache CloudStack 4.3
Hypervisor Capabilities in Apache CloudStack 4.3
 
[OpenStack Day in Korea 2015] Track 1-4 - VDI OpenStack? It Works!!!
[OpenStack Day in Korea 2015] Track 1-4 - VDI OpenStack? It Works!!![OpenStack Day in Korea 2015] Track 1-4 - VDI OpenStack? It Works!!!
[OpenStack Day in Korea 2015] Track 1-4 - VDI OpenStack? It Works!!!
 
Hypervisor selection in CloudStack
Hypervisor selection in CloudStackHypervisor selection in CloudStack
Hypervisor selection in CloudStack
 
VMware HCI solutions - 2020-01-16
VMware HCI solutions - 2020-01-16VMware HCI solutions - 2020-01-16
VMware HCI solutions - 2020-01-16
 
Securing open stack for compliance
Securing open stack for complianceSecuring open stack for compliance
Securing open stack for compliance
 
vert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVMvert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVM
 
Securing your Cloud Environment
Securing your Cloud EnvironmentSecuring your Cloud Environment
Securing your Cloud Environment
 
Successfully Deliver and Operate OpenStack in Production with VMware VIO
Successfully Deliver and Operate OpenStack in Production with VMware VIOSuccessfully Deliver and Operate OpenStack in Production with VMware VIO
Successfully Deliver and Operate OpenStack in Production with VMware VIO
 
W jak sposób architektura hipekonwergentna cisco simplivity usprawni działani...
W jak sposób architektura hipekonwergentna cisco simplivity usprawni działani...W jak sposób architektura hipekonwergentna cisco simplivity usprawni działani...
W jak sposób architektura hipekonwergentna cisco simplivity usprawni działani...
 
Containerized Storage for Containers: Why, What and How OpenEBS Works
Containerized Storage for Containers:  Why, What and How OpenEBS WorksContainerized Storage for Containers:  Why, What and How OpenEBS Works
Containerized Storage for Containers: Why, What and How OpenEBS Works
 
VMUG22 Filip Verloy VIO
VMUG22 Filip Verloy VIOVMUG22 Filip Verloy VIO
VMUG22 Filip Verloy VIO
 
Selecting the correct hypervisor for CloudStack 4.5
Selecting the correct hypervisor for CloudStack 4.5Selecting the correct hypervisor for CloudStack 4.5
Selecting the correct hypervisor for CloudStack 4.5
 
Spectre/Meltdown security vulnerabilities FAQ
Spectre/Meltdown security vulnerabilities FAQSpectre/Meltdown security vulnerabilities FAQ
Spectre/Meltdown security vulnerabilities FAQ
 
CloudStack vs OpenStack vs Eucalyptus: IaaS Private Cloud Brief Comparison
CloudStack vs OpenStack vs Eucalyptus: IaaS Private Cloud Brief ComparisonCloudStack vs OpenStack vs Eucalyptus: IaaS Private Cloud Brief Comparison
CloudStack vs OpenStack vs Eucalyptus: IaaS Private Cloud Brief Comparison
 
VIO30 Technical Overview
VIO30 Technical OverviewVIO30 Technical Overview
VIO30 Technical Overview
 
Turning OpenStack Swift into a VM storage platform
Turning OpenStack Swift into a VM storage platformTurning OpenStack Swift into a VM storage platform
Turning OpenStack Swift into a VM storage platform
 
Cloud Based VDI with OpenStack, by Shifen Yang
Cloud Based VDI with OpenStack, by Shifen YangCloud Based VDI with OpenStack, by Shifen Yang
Cloud Based VDI with OpenStack, by Shifen Yang
 
VMWare: Nova and NVP Support - Gary Kotton and Dimitri Desmidt
VMWare: Nova and NVP Support - Gary Kotton and Dimitri DesmidtVMWare: Nova and NVP Support - Gary Kotton and Dimitri Desmidt
VMWare: Nova and NVP Support - Gary Kotton and Dimitri Desmidt
 
Building clouds with apache cloudstack apache roadshow 2018
Building clouds with apache cloudstack   apache roadshow 2018Building clouds with apache cloudstack   apache roadshow 2018
Building clouds with apache cloudstack apache roadshow 2018
 
Comparing IaaS: VMware vs OpenStack vs Google’s Ganeti
Comparing IaaS: VMware vs OpenStack vs Google’s GanetiComparing IaaS: VMware vs OpenStack vs Google’s Ganeti
Comparing IaaS: VMware vs OpenStack vs Google’s Ganeti
 

Similar a Is OSGi Modularity Always Worth It? - Glyn Normington

Is OSGi modularity always worth it?
Is OSGi modularity always worth it?Is OSGi modularity always worth it?
Is OSGi modularity always worth it?
glynnormington
 
GlassFish Server 3.1: Deploying your Java EE 6 Applications
GlassFish Server 3.1: Deploying your Java EE 6 ApplicationsGlassFish Server 3.1: Deploying your Java EE 6 Applications
GlassFish Server 3.1: Deploying your Java EE 6 Applications
Arun Gupta
 
Datasheet was pluginforrd
Datasheet was pluginforrdDatasheet was pluginforrd
Datasheet was pluginforrd
MidVision
 
Datasheet weblogicpluginforrd
Datasheet weblogicpluginforrdDatasheet weblogicpluginforrd
Datasheet weblogicpluginforrd
MidVision
 
VMworld 2014: The Software-Defined Datacenter, VMs, and Containers
VMworld 2014: The Software-Defined Datacenter, VMs, and ContainersVMworld 2014: The Software-Defined Datacenter, VMs, and Containers
VMworld 2014: The Software-Defined Datacenter, VMs, and Containers
VMworld
 
Track 1 Virtualizing Critical Applications with VMWARE VISPHERE by Roshan Shetty
Track 1 Virtualizing Critical Applications with VMWARE VISPHERE by Roshan ShettyTrack 1 Virtualizing Critical Applications with VMWARE VISPHERE by Roshan Shetty
Track 1 Virtualizing Critical Applications with VMWARE VISPHERE by Roshan Shetty
EMC Forum India
 
Cerberus_Presentation1
Cerberus_Presentation1Cerberus_Presentation1
Cerberus_Presentation1
CIVEL Benoit
 

Similar a Is OSGi Modularity Always Worth It? - Glyn Normington (20)

Is OSGi modularity always worth it?
Is OSGi modularity always worth it?Is OSGi modularity always worth it?
Is OSGi modularity always worth it?
 
Virtualization Vs. Containers
Virtualization Vs. ContainersVirtualization Vs. Containers
Virtualization Vs. Containers
 
Level Up Your Integration Testing With Testcontainers
Level Up Your Integration Testing With TestcontainersLevel Up Your Integration Testing With Testcontainers
Level Up Your Integration Testing With Testcontainers
 
Real World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xReal World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.x
 
Real World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xReal World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.x
 
GlassFish Server 3.1: Deploying your Java EE 6 Applications
GlassFish Server 3.1: Deploying your Java EE 6 ApplicationsGlassFish Server 3.1: Deploying your Java EE 6 Applications
GlassFish Server 3.1: Deploying your Java EE 6 Applications
 
GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011
 
VMworld 2013: vSphere UI Platform Best Practices: Putting the Web Client SDK ...
VMworld 2013: vSphere UI Platform Best Practices: Putting the Web Client SDK ...VMworld 2013: vSphere UI Platform Best Practices: Putting the Web Client SDK ...
VMworld 2013: vSphere UI Platform Best Practices: Putting the Web Client SDK ...
 
VMworld 2015: vCloud Air 2015 – Getting Started with Hybrid Cloud
VMworld 2015: vCloud Air 2015 – Getting Started with Hybrid CloudVMworld 2015: vCloud Air 2015 – Getting Started with Hybrid Cloud
VMworld 2015: vCloud Air 2015 – Getting Started with Hybrid Cloud
 
Datasheet was pluginforrd
Datasheet was pluginforrdDatasheet was pluginforrd
Datasheet was pluginforrd
 
The Kubernetes WebLogic revival (part 1)
The Kubernetes WebLogic revival (part 1)The Kubernetes WebLogic revival (part 1)
The Kubernetes WebLogic revival (part 1)
 
Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conferenc...
Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conferenc...Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conferenc...
Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conferenc...
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentation
 
Datasheet weblogicpluginforrd
Datasheet weblogicpluginforrdDatasheet weblogicpluginforrd
Datasheet weblogicpluginforrd
 
VMworld 2014: The Software-Defined Datacenter, VMs, and Containers
VMworld 2014: The Software-Defined Datacenter, VMs, and ContainersVMworld 2014: The Software-Defined Datacenter, VMs, and Containers
VMworld 2014: The Software-Defined Datacenter, VMs, and Containers
 
Track 1 Virtualizing Critical Applications with VMWARE VISPHERE by Roshan Shetty
Track 1 Virtualizing Critical Applications with VMWARE VISPHERE by Roshan ShettyTrack 1 Virtualizing Critical Applications with VMWARE VISPHERE by Roshan Shetty
Track 1 Virtualizing Critical Applications with VMWARE VISPHERE by Roshan Shetty
 
VMworld 2014: How to Build a Hybrid Cloud
VMworld 2014: How to Build a Hybrid CloudVMworld 2014: How to Build a Hybrid Cloud
VMworld 2014: How to Build a Hybrid Cloud
 
Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)
 
Cerberus_Presentation1
Cerberus_Presentation1Cerberus_Presentation1
Cerberus_Presentation1
 
vRealize Storage Automation and SolidFire
vRealize Storage Automation and SolidFirevRealize Storage Automation and SolidFire
vRealize Storage Automation and SolidFire
 

Más de mfrancis

Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
mfrancis
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
mfrancis
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
mfrancis
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
mfrancis
 

Más de mfrancis (20)

Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
 
OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)
 
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
 
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank LyaruuOSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
 
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
 
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
 
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
 
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
 
OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
 
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
 
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
 
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
 
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
 
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
 
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
 
How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 

Is OSGi Modularity Always Worth It? - Glyn Normington

  • 1. Is OSGi Modularity Always Worth It? Glyn Normington
  • 2. Agenda • Costs and benefits • Case studies • When is OSGi worth it?
  • 3. OSGi Benefits ✓Encapsulated module internals ✓Easier to understand, maintain, and extend ✓Explicit, versioned dependencies ✓Simplified impact analysis ✓Faster class loading ✓Visible architecture ✓bundles, services, dependencies ✓execution environment
  • 5. OSGi Costs Learning: OSGi, new runtime, new tools Reusing 3rd party JARs Designing appropriate bundles and services Defining and upgrading dependencies Building bundles Debugging resolution failures and class loading Coping with dynamism
  • 7. vert.x • Asynchronous, event-driven web apps • HTTP, WebSockets, sockjs • Apps in Java, Groovy, JavaScript, Ruby •Apps need not be thread safe • JSON event bus
  • 8. class loaderclass loader server verticle busmod event bus JSON JSON client vert.x HTTP, WebSockets, sockjs modulemodule
  • 9. Converting vert.x to OSGi • Convert vert.x runtime to bundles • Convert verticles to bundles • (Convert busmods to bundles - similarly)
  • 10. Convert Runtime to Bundles • JARs: • vert.x core • Netty - network IO • Jackson & Jackson Mapper - JSON
  • 11. Approach • Eye-ball existing OSGi manifests • Generate manifests where necessary • Use bnd orVirgo bundlor • Create a manifest template • Test resolution
  • 12. Existing OSGi Manifests ✓Netty • Bundle version 3.4.2.Final ✓Jackson & Jackson Mapper • Bundle version 1.9.4
  • 13. Bundle vert.x core • Use bnd orVirgo bundlor • Manifest template required ...
  • 14. vert.x Core Template • vert.x name and version Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.vertx.core Bundle-Name: vert.x Core Bundle-Version: 1.0.0.final Export-Template: *;version="1.0.0.final"
  • 15. vert.x Core Template • Package import template version ranges • Netty: [3.4.2.Final, 4.0) • Jackson: [1.9.4, 2.0) • Other optional imports: 0 • 0 means [0, ∞)
  • 16. • Package import version ranges • Netty: [3.4.2.Final, 4.0) • Jackson: [1.9.4, 2.0) • Other optional imports: 0 • 0 means [0, ∞) vert.x Core Template Where did these come from?
  • 17. Version Ranges • Lower bound • What did you test? • What old versions do you support? • Upper bound • Exporter’s versioning policy? • How easy is it to change your bundle? • Lifespan? • Distribution?
  • 19. Generate Bundle bundlor.sh -i vert.x-core.jar -m vertx.core.mf -o vert.x-core-1.0.0.final.jar
  • 20. Test Metadata • UsingVirgo, for simplicity • Place dependencies in repository/usr • Place vert.x core in pickup • StartVirgo: ... <DE0005I> Started bundle 'org.vertx.core' version '1.0.0.final'.
  • 22. public class MyVerticle extends Verticle { public void start() { vertx.createHttpServer().requestHandler( new Handler<HttpServerRequest>() { public void handle(HttpServerRequest req) { ... } } ).listen(8080); } }
  • 23. public class MyVerticle extends Verticle { public void start() { vertx.createHttpServer().requestHandler( new Handler<HttpServerRequest>() { public void handle(HttpServerRequest req) { ... } } ).listen(8080); } }
  • 24. public class MyVerticle extends Verticle { public void start() { vertx.createHttpServer().requestHandler( new Handler<HttpServerRequest>() { public void handle(HttpServerRequest req) { ... } } ).listen(8080); } } redundant boilerplate
  • 25. public class MyVerticle extends Verticle { public void start() { vertx.createHttpServer().requestHandler( new Handler<HttpServerRequest>() { public void handle(HttpServerRequest req) { ... } } ).listen(8080); } } redundant boilerplate not easily unit tested
  • 26. public class MyVerticle extends Verticle { public void start() { vertx.createHttpServer().requestHandler( new Handler<HttpServerRequest>() { public void handle(HttpServerRequest req) { ... } } ).listen(8080); } } baked-in configuration redundant boilerplate not easily unit tested
  • 27. ModularVerticle • Move boilerplate code to a support bundle • Convert configuration to declarative metadata • Use services for loose coupling • whiteboard pattern
  • 28. public class MyHandler implements Handler<HttpServerRequest> { public void handle(HttpServerRequest req) { ... } }
  • 29. <?xml version="1.0" encoding="UTF-8"?> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> <bean class="org.vertx.osgi.sample.MyHandler" id="handler"/> <service interface="org.vertx.java.core.Handler" ref="handler"> <service-properties> <entry key="type" value="HttpServerRequestHandler"> <entry key="port" value="8080"> </service-properties> </service> </blueprint>
  • 30. org.vertx.core bundle modular verticle bundle org.vertx.osgi bundle OSGi Service Registry 2. publish handler 3. listen for/find handler 4. create server 5 register handler 6. set server listening 7. request from network 8. Handler.handle()9. HttpServerRequest operations blueprint service 1. listen for/find bundle
  • 32. Benefits ✓vertx implementation can be hidden ✓Boilerplate factored out ✓Unit testing simplified ✓Configuration externalised
  • 33. Costs Deciding dependency version ranges Reworking vert.x to improve encapsulation Programming model changed Shared dependencies must be thread safe
  • 34. Costs Deciding dependency version ranges Reworking vert.x to improve encapsulation Programming model changed Shared dependencies must be thread safe Conclusion: probably not worth it
  • 36. vSphere Web Client • OSGi based web server • Virgo Server for Apache Tomcat • Plugins allow users to extend the Web Client • Custom data • Custom relationships (for new/existing data)
  • 37. browser Virgo (vSphere Web Client) vCenter Server Flex UI component Data Service VMware Inventory Service ESX Server ESX Server ESX Server VMVMVM BlazeDS
  • 38. browser Virgo (vSphere Web Client) vCenter Server Flex UI component Data Service VMware Inventory Service Remote Data Source Custom Flex UI component Custom Data Service ESX Server ESX Server ESX Server VMVMVM plugin zip plugin zip plugin zip BlazeDS BlazeDS
  • 40. Benefits ✓Modular ✓Extensible by users ✓Internals not accessible to users ✓Dynamically updateable
  • 41. Costs Steep initial learning curve Investment required inVirgo tooling OSGi exposed to users
  • 42. Costs Steep initial learning curve Investment required inVirgo tooling OSGi exposed to users Conclusion: worth it
  • 44. Overview • Virgo 3.0.3, EclipseLink,Atomikos, ActiveMQ,Tomcat clustering, Hazelcast • In production for more than a year • last 7 months as a cluster • Nearly 1 million user accounts • 100s of web requests per second, peak • Only one major outage, due to a Linux bug
  • 45. Cited Benefits ✓Better understand components you use ✓Cleaner, higher quality code ✓Better system architecture ✓Reusable modules
  • 46. Cited Costs Time to learn the intricacies of OSGi Time to integrate non-OSGi ready components
  • 47. Cited Costs Time to learn the intricacies of OSGi Time to integrate non-OSGi ready components Conclusion: worth it
  • 49. OSGi Costs Learning: OSGi, new runtime, new tools Reusing 3rd party JARs Designing appropriate bundles and services Defining and upgrading dependencies Building bundles Debugging resolution failures and class loading Coping with dynamism Reduced isolation in some cases Further investment in tooling required
  • 50. OSGi Benefits ✓Encapsulated module internals ✓Explicit, versioned dependencies ✓Side-by-side versioning ✓Dynamism ✓Visible architecture ✓Loose coupling via services ✓Better understanding of components used ✓Reusable modules
  • 51. When is OSGi worth it? ✓Lower layers benefit most ✓Control dependencies ✓Hide internals Lower layers push higher layers to OSGi ? Exposing OSGi to users ✓Long-lived or critical applications
  • 52. PRO TANTO QUID RETRIBUAMUS For so much, what shall we give in return? (wording from the edge of the Belfast £1 coin)
  • 53. Further Information • “Java Application Architecture” by Kirk Knoernschild • http://www.osgi.org • http://underlap.blogspot.co.uk/2012/06/osgi- case-study-modular-vertx.html • http://vertx.io/ • http://underlap.blogspot.co.uk/2012/10/ virgo-in-vsphere.html • http://www.osgi.org/wiki/uploads/Links/ SemanticVersioning.pdf
  • 54. Credits • “Coins” by Rob Redwood • “Benefits of using OSGi” http://www.osgi.org/Technology/WhyOSGi • “One Pound” by Leo Reynolds