SlideShare una empresa de Scribd logo
1 de 25
Descargar para leer sin conexión
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
Tim Ward

tim.ward@paremus.com
OSGi enRoute Quickstart -
A Beginners Guide to OSGi
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
Who is Tim Ward?
Chief Technology Officer at Paremus
10 years developing OSGi specifications
Co-chair of the OSGi IoT Expert Group
Interested in Asynchronous Distributed Systems
Author of Manning’s Enterprise OSGi in Action
http://www.manning.com/cummins
@TimothyWard
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
OSGi Modularity in 60 seconds
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
OSGi Modules
OSGi is a modularity framework for Java
The Modules are JAR files known as “Bundles”
Bundles have private internal code
Shared packages must be exported
Exported packages must be imported to be accessible
org.a.api org.a.api
org.b.impl
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
OSGi Modules (2)
The metadata for a bundle lives in the Manifest
The manifest headers define:
A name for the bundle
A version for the bundle
The imported/exported packages for the bundle
Other requirements/capabilities
Getting the Manifest correct is vitally important
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
OSGi Services
OSGi Bundles communicate using the Service Registry
This allows for dynamic, loosely coupled interaction
Consumer
Provider B
Provider A
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
OSGi Services
OSGi Services are dynamic
They can come and go at any time
OSGi services may depend on other services
You must unregister if your dependency unregisters
One change can cascade across lots of modules
Failing to use services properly gives poor quality bundles
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
Developing for OSGi
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
Developing bundles
Ok, so that took more than 60 seconds…
Developing bundles involves writing Java code as normal
Then you have to get the Manifest correct
Do you really know all the packages you use in your code?
If you’re using services then you must listen for them
Failure to do so leads to start up ordering concerns
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
That sounds like a nightmare!
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
The reason for OSGi enRoute
When people start to use OSGi for the first time…
They look at the core specification (not a bad idea)
They get as far as “Bundle-Activator” and then stop 😞
The compendium specification contains many vital things
They look for examples on the internet
Some examples are very old, or just not very good!
Hand writing a manifest file is never a good idea
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
The reason for OSGi enRoute (2)
There are lots of good tools for writing OSGi bundles
They are often not well documented, and set up is rarely trivial
The latest OSGi specs are much more user friendly
Annotation driven services, requirements, capabilities
We need a go-to place which demonstrates
OSGi best practices
A familiar toolchain
Worked examples using the OSGi compendium
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
So what is OSGi enRoute?
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
The anatomy of OSGi enRoute
OSGi enRoute is a GitHub project using Maven
OSGi enRoute provides four things for users
1. Example Projects
2. Maven Project Templates (Archetypes)
3. Usefully curated OSGi Indexes/Maven dependencies
4. A Website describing how to use all of these things!
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
Why is OSGi enRoute using Maven
Because it’s the right choice!
Some people love Maven, and some people hate it
But pretty much everyone knows how to use it!
OSGi enRoute isn’t a build tool tutorial
Deliberately use the most common tool
Fit in with established layouts and patterns
Allow users to continue using all of their other tools/plugins
Importantly, there are plugins from bnd to do all the hard work!
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
The OSGi enRoute examples
OSGi enRoute provides examples using the Compendium
JAX-RS whiteboard microservices
Transaction Control based Data Access
Using JPA or JDBC!
Using and Customising the OSGi Converter
Each example is provided with a guide to the key points
All bundle metadata and services automatically managed
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
The OSGi enRoute archetypes
Archetypes are a fancy Maven name for project templates
They can be published to repositories, and used via Maven tools
There are lots of different enRoute archetypes
Setting up a new build
Creating an API bundle
Creating a JAX-RS microservice bundle
Integration testing
Wrapping up a runnable application
…
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
The OSGi enRoute indexes
In some ways these seem less important
They’re actually the basis for everything else!
A key problem when starting OSGi is finding stuff
And what you do find can be of questionable quality
The indexes wrap up groups of useful dependencies
They include reference implementations of OSGi specifications
All of the contents are vetted for “good OSGi packaging”
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
The OSGi enRoute website
Available at https://enroute.osgi.org
Contributions can be made on GitHub (osgi/osgi.enroute.site)
The primary goal of the website is to explain the examples
Several examples have step-by-step tutorials
All of the tutorials can be run from the command line
Optional instructions show how to use the Eclipse IDE
The website also provides basic background and FAQs
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
Using OSGi enRoute
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
How to use OSGi enRoute
It’s been 15 slides since the last picture…
You’ve all done very well 😊
The purpose of enRoute is to be quick and easy
So the best way to explain it is to use it!
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
Switch to Eclipse
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
Evaluate the Sessions
-1 0 +1
Sign in and vote at eclipsecon.org
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
Questions?
Copyright © 2018 Paremus Ltd.

May not be reproduced by any means without express permission. All rights reserved.
OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018
www.paremus.com @Paremus info@paremus.com

Más contenido relacionado

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
 
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)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
 
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...mfrancis
 
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)mfrancis
 
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)mfrancis
 
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)mfrancis
 
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...mfrancis
 
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)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
 
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)mfrancis
 
Visualization of OSGi based Software Architectures in Virtual Reality - Lisa ...
Visualization of OSGi based Software Architectures in Virtual Reality - Lisa ...Visualization of OSGi based Software Architectures in Virtual Reality - Lisa ...
Visualization of OSGi based Software Architectures in Virtual Reality - Lisa ...mfrancis
 
Turtles all the Way Up – From OSGi bundles to Fog Computing - Tim Ward (Paremus)
Turtles all the Way Up – From OSGi bundles to Fog Computing - Tim Ward (Paremus)Turtles all the Way Up – From OSGi bundles to Fog Computing - Tim Ward (Paremus)
Turtles all the Way Up – From OSGi bundles to Fog Computing - Tim Ward (Paremus)mfrancis
 
OSGi in Action - How we use OSGi to build Open Liberty - Alasdair Nottingham ...
OSGi in Action - How we use OSGi to build Open Liberty - Alasdair Nottingham ...OSGi in Action - How we use OSGi to build Open Liberty - Alasdair Nottingham ...
OSGi in Action - How we use OSGi to build Open Liberty - Alasdair Nottingham ...mfrancis
 
Software AG Application Modularity - OSGi and JPMS (Jigsaw)
Software AG Application Modularity - OSGi and JPMS (Jigsaw)Software AG Application Modularity - OSGi and JPMS (Jigsaw)
Software AG Application Modularity - OSGi and JPMS (Jigsaw)mfrancis
 
Journey from Monolith to a Modularized Application - Approach and Key Learnin...
Journey from Monolith to a Modularized Application - Approach and Key Learnin...Journey from Monolith to a Modularized Application - Approach and Key Learnin...
Journey from Monolith to a Modularized Application - Approach and Key Learnin...mfrancis
 
Eclipse microprofile config and OSGi config admin - E Jiang
Eclipse microprofile config and OSGi config admin - E JiangEclipse microprofile config and OSGi config admin - E Jiang
Eclipse microprofile config and OSGi config admin - E Jiangmfrancis
 
Smart IoTt on OSGi with Apache Openwhisk - C Ziegeler & D Bosschaert
Smart IoTt on OSGi with Apache Openwhisk - C Ziegeler & D BosschaertSmart IoTt on OSGi with Apache Openwhisk - C Ziegeler & D Bosschaert
Smart IoTt on OSGi with Apache Openwhisk - C Ziegeler & D Bosschaertmfrancis
 
When whiteboards play together. JAX-RS and servlets the OSGi way - M Hoffmann...
When whiteboards play together. JAX-RS and servlets the OSGi way - M Hoffmann...When whiteboards play together. JAX-RS and servlets the OSGi way - M Hoffmann...
When whiteboards play together. JAX-RS and servlets the OSGi way - M Hoffmann...mfrancis
 

Más de mfrancis (20)

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)
 
Visualization of OSGi based Software Architectures in Virtual Reality - Lisa ...
Visualization of OSGi based Software Architectures in Virtual Reality - Lisa ...Visualization of OSGi based Software Architectures in Virtual Reality - Lisa ...
Visualization of OSGi based Software Architectures in Virtual Reality - Lisa ...
 
Turtles all the Way Up – From OSGi bundles to Fog Computing - Tim Ward (Paremus)
Turtles all the Way Up – From OSGi bundles to Fog Computing - Tim Ward (Paremus)Turtles all the Way Up – From OSGi bundles to Fog Computing - Tim Ward (Paremus)
Turtles all the Way Up – From OSGi bundles to Fog Computing - Tim Ward (Paremus)
 
OSGi in Action - How we use OSGi to build Open Liberty - Alasdair Nottingham ...
OSGi in Action - How we use OSGi to build Open Liberty - Alasdair Nottingham ...OSGi in Action - How we use OSGi to build Open Liberty - Alasdair Nottingham ...
OSGi in Action - How we use OSGi to build Open Liberty - Alasdair Nottingham ...
 
Software AG Application Modularity - OSGi and JPMS (Jigsaw)
Software AG Application Modularity - OSGi and JPMS (Jigsaw)Software AG Application Modularity - OSGi and JPMS (Jigsaw)
Software AG Application Modularity - OSGi and JPMS (Jigsaw)
 
Journey from Monolith to a Modularized Application - Approach and Key Learnin...
Journey from Monolith to a Modularized Application - Approach and Key Learnin...Journey from Monolith to a Modularized Application - Approach and Key Learnin...
Journey from Monolith to a Modularized Application - Approach and Key Learnin...
 
Eclipse microprofile config and OSGi config admin - E Jiang
Eclipse microprofile config and OSGi config admin - E JiangEclipse microprofile config and OSGi config admin - E Jiang
Eclipse microprofile config and OSGi config admin - E Jiang
 
Smart IoTt on OSGi with Apache Openwhisk - C Ziegeler & D Bosschaert
Smart IoTt on OSGi with Apache Openwhisk - C Ziegeler & D BosschaertSmart IoTt on OSGi with Apache Openwhisk - C Ziegeler & D Bosschaert
Smart IoTt on OSGi with Apache Openwhisk - C Ziegeler & D Bosschaert
 
When whiteboards play together. JAX-RS and servlets the OSGi way - M Hoffmann...
When whiteboards play together. JAX-RS and servlets the OSGi way - M Hoffmann...When whiteboards play together. JAX-RS and servlets the OSGi way - M Hoffmann...
When whiteboards play together. JAX-RS and servlets the OSGi way - M Hoffmann...
 

Último

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

OSGi enRoute for R7 – getting started the easy way! - Tim Ward (Paremus)

  • 1. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 Tim Ward
 tim.ward@paremus.com OSGi enRoute Quickstart - A Beginners Guide to OSGi
  • 2. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 Who is Tim Ward? Chief Technology Officer at Paremus 10 years developing OSGi specifications Co-chair of the OSGi IoT Expert Group Interested in Asynchronous Distributed Systems Author of Manning’s Enterprise OSGi in Action http://www.manning.com/cummins @TimothyWard
  • 3. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 OSGi Modularity in 60 seconds
  • 4. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 OSGi Modules OSGi is a modularity framework for Java The Modules are JAR files known as “Bundles” Bundles have private internal code Shared packages must be exported Exported packages must be imported to be accessible org.a.api org.a.api org.b.impl
  • 5. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 OSGi Modules (2) The metadata for a bundle lives in the Manifest The manifest headers define: A name for the bundle A version for the bundle The imported/exported packages for the bundle Other requirements/capabilities Getting the Manifest correct is vitally important
  • 6. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 OSGi Services OSGi Bundles communicate using the Service Registry This allows for dynamic, loosely coupled interaction Consumer Provider B Provider A
  • 7. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 OSGi Services OSGi Services are dynamic They can come and go at any time OSGi services may depend on other services You must unregister if your dependency unregisters One change can cascade across lots of modules Failing to use services properly gives poor quality bundles
  • 8. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 Developing for OSGi
  • 9. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 Developing bundles Ok, so that took more than 60 seconds… Developing bundles involves writing Java code as normal Then you have to get the Manifest correct Do you really know all the packages you use in your code? If you’re using services then you must listen for them Failure to do so leads to start up ordering concerns
  • 10. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 That sounds like a nightmare!
  • 11. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 The reason for OSGi enRoute When people start to use OSGi for the first time… They look at the core specification (not a bad idea) They get as far as “Bundle-Activator” and then stop 😞 The compendium specification contains many vital things They look for examples on the internet Some examples are very old, or just not very good! Hand writing a manifest file is never a good idea
  • 12. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 The reason for OSGi enRoute (2) There are lots of good tools for writing OSGi bundles They are often not well documented, and set up is rarely trivial The latest OSGi specs are much more user friendly Annotation driven services, requirements, capabilities We need a go-to place which demonstrates OSGi best practices A familiar toolchain Worked examples using the OSGi compendium
  • 13. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 So what is OSGi enRoute?
  • 14. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 The anatomy of OSGi enRoute OSGi enRoute is a GitHub project using Maven OSGi enRoute provides four things for users 1. Example Projects 2. Maven Project Templates (Archetypes) 3. Usefully curated OSGi Indexes/Maven dependencies 4. A Website describing how to use all of these things!
  • 15. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 Why is OSGi enRoute using Maven Because it’s the right choice! Some people love Maven, and some people hate it But pretty much everyone knows how to use it! OSGi enRoute isn’t a build tool tutorial Deliberately use the most common tool Fit in with established layouts and patterns Allow users to continue using all of their other tools/plugins Importantly, there are plugins from bnd to do all the hard work!
  • 16. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 The OSGi enRoute examples OSGi enRoute provides examples using the Compendium JAX-RS whiteboard microservices Transaction Control based Data Access Using JPA or JDBC! Using and Customising the OSGi Converter Each example is provided with a guide to the key points All bundle metadata and services automatically managed
  • 17. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 The OSGi enRoute archetypes Archetypes are a fancy Maven name for project templates They can be published to repositories, and used via Maven tools There are lots of different enRoute archetypes Setting up a new build Creating an API bundle Creating a JAX-RS microservice bundle Integration testing Wrapping up a runnable application …
  • 18. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 The OSGi enRoute indexes In some ways these seem less important They’re actually the basis for everything else! A key problem when starting OSGi is finding stuff And what you do find can be of questionable quality The indexes wrap up groups of useful dependencies They include reference implementations of OSGi specifications All of the contents are vetted for “good OSGi packaging”
  • 19. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 The OSGi enRoute website Available at https://enroute.osgi.org Contributions can be made on GitHub (osgi/osgi.enroute.site) The primary goal of the website is to explain the examples Several examples have step-by-step tutorials All of the tutorials can be run from the command line Optional instructions show how to use the Eclipse IDE The website also provides basic background and FAQs
  • 20. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 Using OSGi enRoute
  • 21. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 How to use OSGi enRoute It’s been 15 slides since the last picture… You’ve all done very well 😊 The purpose of enRoute is to be quick and easy So the best way to explain it is to use it!
  • 22. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 Switch to Eclipse
  • 23. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 Evaluate the Sessions -1 0 +1 Sign in and vote at eclipsecon.org
  • 24. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 Questions?
  • 25. Copyright © 2018 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. OSGi enRoute Quickstart - A Beginners Guide to OSGi October 2018 www.paremus.com @Paremus info@paremus.com