Microservices OSGi-running-with-apache-karaf

Achim Nierbeck
Achim NierbeckStandortleiter Karlsruhe bei codecentric AG um codecentric AG
Microservices and OSGi
running with Apache Karaf
•No free Lunch - microservices
•microservices or µService?
•Free Lunch? - OSGi µServices
•µServices in the Apache Karaf ecosystem
•https://github.com/ANierbeck/Karaf-Microservices-Tooling
•https://github.com/ANierbeck/Karaf-Microservices
2
Agenda
Showcase:
3
@anierbeck
Senior IT-Consultant @codecentric
Apache Karaf PMC
Apache Member
OPS4j Pax Web Project lead
Co-Author Apache Karaf Cookbook
No Free Lunch - with micro services_
4
01
No Free Lunch - with micro services_
Operations overhead
Instead of one Application (cluster)
micro applications that need to be
clustered / Orchestrated / Operated
01
No Free Lunch - with micro services_
DevOps Skills Required
old school: One AppServer one
application
now: applications that might run on
different infrastructure
Instead of bigger boats,
more boats are needed
01
No Free Lunch - with micro services_
Implicit Interfaces
Changes in:
•syntax
•semantics
01
No Free Lunch - with micro services_
Distributed System
Complexity
network latency
fault tolerance
message serialization
distributed transactions
01
No Free Lunch - with micro services_
A/Synchronicity

is Difficult!
communication is much more
asynchronous
it gets complex when you need to
correlate messages
or distributed transactions
01
No Free Lunch - with micro services_
Testability Challenges
testing a single service is easy
monitoring the dynamic environment
is hard
—> less testing, more monitoring
µService - comparison of two definition_
11
—Peter Kriens, March 2010
http://blog.osgi.org/2010/03/services.html
“What I am promoting is the idea of
µServices, the concepts of an OSGi
service as a design primitive.”
12
–Martin Fowler, March 2014
“In short, the microservice architectural style is an
approach to developing a single application as a
suite of small services, each running in its own
process and communicating with lightweight
mechanisms, often an HTTP resource API. These
services are built around business capabilities and
independently deployable by fully automated
deployment machinery. There is a bare mininum of
centralized management of these services, which
may be written in different programming languages
and use different data storage technologies.”
13
•One main reason for using services as components (rather than libraries) is that
services are independently deployable 

OSGi Bundle
•you can expect many single service changes to only require that service to be
redeployed

OSGi Service / Bundle
•cohesive service boundaries and evolution mechanisms in the service contracts 

OSGi Versioning
•Often it's only documentation and discipline that prevents clients breaking a
component's encapsulation, leading to overly-tight coupling between
components.

OSGi Container enforces this
in detail_
14
Free Lunch? OSGi µServices_
15
01
Free Lunch? OSGi µServices_
Operations Overhead
OSGi Bundles - containing services
One container vessel
One Server to know
Apache_
17
OSGi Framework
18
JAAS
Deployer
Console
Blueprint
LoggingConfig
HttpWAR
Features
Instance
OBR
KAR
JMX
JPA JTA Cellar
CoreStandardApache Karaf_
JNDI JMS JDBC
µServices µServices µServices
JAX-RS
µServices
01
Free Lunch? OSGi µServices_
DevOps Skills Required
requirements are reduced!
- Karaf - Ops
- OSGi - Devs
01
Free Lunch? OSGi µServices_
Implicit Interfaces
semantic versioning
OSGi supports multiple versions
multiple service implementations
tools help
21
Semantic Versioning_
1. major
Packages with versions that have different major parts are not compatible both for providers as
well as consumers. For example, 1.2 and 2.3 are completely incompatible.

2. minor
API consumers are compatible with exporters that have the same major number and an equal or
higher minor version. API providers are compatible with exporters that have the same major and
minor version number. For example, 1.2 is backward compatible with 1.1 for consumers but for
providers it is incompatible. Consumers should therefore import [1.2,2) and providers should
import [1.2,1.3).

3. micro
A difference in the micro part does not signal any backward compatibility issues. The micro
number is used to fix bugs that do not affect either consumers or providers of the API.

4. qualifier
The qualifier is usually used to indicate a build identity, for example a time stamp. Different
qualifiers do not signal any backward compatibility issues.
22
maven-bundle-plugin
Semantic Versioning - Tools_
01
Semantic Versioning - Tools_
Release - Baselining
Fix version 1.0.0
Baseline new version with 1.0.0
version
•Comparing bundle service-api version 1.0.0-SNAPSHOT to version 1.0.0-SNAPSHOT

PACKAGE_NAME DELTA CUR_VER BASE_VER REC_VER WARNINGS

= ================================================== ========== ========== ========== ========== ==========

de.nierbeck.microservices.karaf.calculator unchanged 1.0.0 1.0.0 1.0.0 -

-----------------------------------------------------------------------------------------------------------

de.nierbeck.microservices.karaf.calculator.values unchanged 1.0.0 1.0.0 1.0.0 -

-----------------------------------------------------------------------------------------------------------

Baseline analysis complete, 0 error(s), 0 warning(s)
Semantic Versioning - Baselining_
24
Baselining
01
Free Lunch? OSGi µServices_
Distributed System
Complexity
complexity reduced -> one container
no network traffic
service calls ->
method calls from services found in
service registry.
Clustering: Apache Karaf Cellar
Remote: DOSGi —> CXF, Cellar
01
Free Lunch? OSGi µServices_
A/Synchronicity

is Difficult!
in JVM communication
service calls - transparent call
stateless services
event communication
Out-Of-The-Box
01
Free Lunch? OSGi µServices_
Testability Challenges
POJO tests for business logic
Pax EXAM - Integration tests of OSGi
services.
Shift Focus:
More Testing, less monitoring
28
Service tests - Pax EXAM - Continous Integration_
µServices in the Apache Karaf ecosystem_
29
30
µServices in the Apache Karaf ecosystem_
microservices made of µServices …
01
µServices in the Apache Karaf ecosystem_
Apache Karaf Cellar
Hazelcast based cluster
Groups and Nodes
Services across Clusters
Failover
Load balanced
01
µServices in the Apache Karaf ecosystem_
Apache Karaf Cave
OSGi Repository
Bundle
Requirements
Capabilities
01
µServices in the Apache Karaf ecosystem_
Apache Karaf Decanter
Monitor
Elasticsearch
Kibana
Continous Delivery with Apache Karaf_
34
Continous Deployment_
35
36
{
"type":"EXEC",
"mbean":"org.apache.karaf:type=bundle,name=root",
"operation":"install(java.lang.String,boolean)",
"arguments":["mvn:${project.groupId}/${project.artifactId}/${project.version}", true]
}
•deployment via REST
•Jolokia - REST
•JMX Management
•Maven Plugin
Continous Deployment_
µServices - sum of all services_
37
01
µServices - sum of all services_
Should I do
microservices
YES!
Monolithic blocks are bad
Use:
- Low Coupling
- High Cohesion
01
µServices - sum of all services_
The Silver Bullet?
NO!
OSGi isn’t the silver Bullet
A lot of issues which exist with
µ-Services are already solved in the
OSGi - Eco system
01
µServices - sum of all services_
Blueprint?
YES!
Use it as blueprint for transition to
microservices
OSGi - µServices will help in breaking
up the Monolith
01
µServices - sum of all services_
microservice based on
µServices
instead of building micro-monolith
base on OSGi services.
Questions ?
•images found at flickr - thanks to that
•No Free Lunch with Microservices

http://highscalability.com/blog/2014/4/8/microservices-not-a-
free-lunch.html
•http://karaf.apache.org/
•http://blog.osgi.org/2010/03/services.html
•https://github.com/ANierbeck/Karaf-Microservices-Tooling
•https://github.com/ANierbeck/Karaf-Microservices
END_
43
Links:
Showcase:
44
1 von 44

Recomendados

Developing Microservices with Apache Camel von
Developing Microservices with Apache CamelDeveloping Microservices with Apache Camel
Developing Microservices with Apache CamelClaus Ibsen
6.8K views101 Folien
Integrating microservices with apache camel on kubernetes von
Integrating microservices with apache camel on kubernetesIntegrating microservices with apache camel on kubernetes
Integrating microservices with apache camel on kubernetesClaus Ibsen
2.2K views72 Folien
[2018 .NET Conf].NET Core與Azure DevOps應用於企業開發 von
[2018 .NET Conf].NET Core與Azure DevOps應用於企業開發[2018 .NET Conf].NET Core與Azure DevOps應用於企業開發
[2018 .NET Conf].NET Core與Azure DevOps應用於企業開發Edward Kuo
420 views47 Folien
Getting started with Apache Camel presentation at BarcelonaJUG, january 2014 von
Getting started with Apache Camel presentation at BarcelonaJUG, january 2014Getting started with Apache Camel presentation at BarcelonaJUG, january 2014
Getting started with Apache Camel presentation at BarcelonaJUG, january 2014Claus Ibsen
7.2K views105 Folien
Ansible: Infrastructure as Code for OpenShift von
Ansible: Infrastructure as Code for OpenShiftAnsible: Infrastructure as Code for OpenShift
Ansible: Infrastructure as Code for OpenShiftIgnacio Sánchez Ginés
569 views27 Folien
How to Monitoring the SRE Golden Signals (E-Book) von
How to Monitoring the SRE Golden Signals (E-Book)How to Monitoring the SRE Golden Signals (E-Book)
How to Monitoring the SRE Golden Signals (E-Book)Siglos
14.1K views36 Folien

Más contenido relacionado

Was ist angesagt?

Tomcat and apache httpd training von
Tomcat and apache httpd trainingTomcat and apache httpd training
Tomcat and apache httpd trainingFranck SIMON
28K views278 Folien
Zero downtime deployment of micro-services with Kubernetes von
Zero downtime deployment of micro-services with KubernetesZero downtime deployment of micro-services with Kubernetes
Zero downtime deployment of micro-services with KubernetesWojciech Barczyński
599 views70 Folien
오픈소스컨설팅 클러스터제안 V1.0 von
오픈소스컨설팅 클러스터제안 V1.0오픈소스컨설팅 클러스터제안 V1.0
오픈소스컨설팅 클러스터제안 V1.0sprdd
5.5K views16 Folien
CQRS and Event Sourcing von
CQRS and Event SourcingCQRS and Event Sourcing
CQRS and Event SourcingSergey Seletsky
983 views39 Folien
Introduction to kubernetes von
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetesRaffaele Di Fazio
576 views38 Folien
Feature Toggles von
Feature TogglesFeature Toggles
Feature TogglesDevi Sridharan
1.4K views20 Folien

Was ist angesagt?(20)

Tomcat and apache httpd training von Franck SIMON
Tomcat and apache httpd trainingTomcat and apache httpd training
Tomcat and apache httpd training
Franck SIMON28K views
Zero downtime deployment of micro-services with Kubernetes von Wojciech Barczyński
Zero downtime deployment of micro-services with KubernetesZero downtime deployment of micro-services with Kubernetes
Zero downtime deployment of micro-services with Kubernetes
오픈소스컨설팅 클러스터제안 V1.0 von sprdd
오픈소스컨설팅 클러스터제안 V1.0오픈소스컨설팅 클러스터제안 V1.0
오픈소스컨설팅 클러스터제안 V1.0
sprdd5.5K views
事例から見る規模別クラウド・データベースの選び方 (Oracle Database) (Oracle Cloudウェビナーシリーズ: 2021年6月30日) von オラクルエンジニア通信
事例から見る規模別クラウド・データベースの選び方 (Oracle Database) (Oracle Cloudウェビナーシリーズ: 2021年6月30日)事例から見る規模別クラウド・データベースの選び方 (Oracle Database) (Oracle Cloudウェビナーシリーズ: 2021年6月30日)
事例から見る規模別クラウド・データベースの選び方 (Oracle Database) (Oracle Cloudウェビナーシリーズ: 2021年6月30日)
Using Rook to Manage Kubernetes Storage with Ceph von CloudOps2005
Using Rook to Manage Kubernetes Storage with CephUsing Rook to Manage Kubernetes Storage with Ceph
Using Rook to Manage Kubernetes Storage with Ceph
CloudOps2005887 views
Rancher and Kubernetes Best Practices von Avinash Patil
Rancher and  Kubernetes Best PracticesRancher and  Kubernetes Best Practices
Rancher and Kubernetes Best Practices
Avinash Patil511 views
Open shift 4 infra deep dive von Winton Winton
Open shift 4    infra deep diveOpen shift 4    infra deep dive
Open shift 4 infra deep dive
Winton Winton16.2K views
Quarkus - a next-generation Kubernetes Native Java framework von SVDevOps
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java framework
SVDevOps606 views
knolx of KubeCost & Infracost von Knoldus Inc.
knolx of KubeCost & Infracostknolx of KubeCost & Infracost
knolx of KubeCost & Infracost
Knoldus Inc.299 views
Application Autoscaling Made Easy with Kubernetes Event-Driven Autoscaling (K... von Codit
Application Autoscaling Made Easy with Kubernetes Event-Driven Autoscaling (K...Application Autoscaling Made Easy with Kubernetes Event-Driven Autoscaling (K...
Application Autoscaling Made Easy with Kubernetes Event-Driven Autoscaling (K...
Codit1.4K views
導讀持續交付 2.0 - 談當代軟體交付之虛實融合 von Rick Hwang
導讀持續交付 2.0 - 談當代軟體交付之虛實融合導讀持續交付 2.0 - 談當代軟體交付之虛實融合
導讀持續交付 2.0 - 談當代軟體交付之虛實融合
Rick Hwang3.6K views
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화 von OpenStack Korea Community
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화

Similar a Microservices OSGi-running-with-apache-karaf

MySQL London Tech Tour March 2015 - MySQL Fabric von
MySQL London Tech Tour March 2015 - MySQL FabricMySQL London Tech Tour March 2015 - MySQL Fabric
MySQL London Tech Tour March 2015 - MySQL FabricMark Swarbrick
546 views34 Folien
Cloudify 4.6 highlights webinar von
Cloudify 4.6 highlights webinarCloudify 4.6 highlights webinar
Cloudify 4.6 highlights webinarCloudify Community
465 views23 Folien
Sql server 2019 New Features by Yevhen Nedaskivskyi von
Sql server 2019 New Features by Yevhen NedaskivskyiSql server 2019 New Features by Yevhen Nedaskivskyi
Sql server 2019 New Features by Yevhen NedaskivskyiAlex Tumanoff
659 views25 Folien
SAP on Azure Web Dispatcher High Availability von
SAP on Azure Web Dispatcher High AvailabilitySAP on Azure Web Dispatcher High Availability
SAP on Azure Web Dispatcher High AvailabilityGary Jackson MBCS
3.7K views13 Folien
Netherlands Tech Tour 02 - MySQL Fabric von
Netherlands Tech Tour 02 -   MySQL FabricNetherlands Tech Tour 02 -   MySQL Fabric
Netherlands Tech Tour 02 - MySQL FabricMark Swarbrick
462 views36 Folien
SAP on Azure. Use Cases and Benefits von
SAP on Azure. Use Cases and BenefitsSAP on Azure. Use Cases and Benefits
SAP on Azure. Use Cases and BenefitsmyCloudDoor
8.4K views18 Folien

Similar a Microservices OSGi-running-with-apache-karaf(20)

MySQL London Tech Tour March 2015 - MySQL Fabric von Mark Swarbrick
MySQL London Tech Tour March 2015 - MySQL FabricMySQL London Tech Tour March 2015 - MySQL Fabric
MySQL London Tech Tour March 2015 - MySQL Fabric
Mark Swarbrick546 views
Sql server 2019 New Features by Yevhen Nedaskivskyi von Alex Tumanoff
Sql server 2019 New Features by Yevhen NedaskivskyiSql server 2019 New Features by Yevhen Nedaskivskyi
Sql server 2019 New Features by Yevhen Nedaskivskyi
Alex Tumanoff659 views
SAP on Azure Web Dispatcher High Availability von Gary Jackson MBCS
SAP on Azure Web Dispatcher High AvailabilitySAP on Azure Web Dispatcher High Availability
SAP on Azure Web Dispatcher High Availability
Gary Jackson MBCS3.7K views
Netherlands Tech Tour 02 - MySQL Fabric von Mark Swarbrick
Netherlands Tech Tour 02 -   MySQL FabricNetherlands Tech Tour 02 -   MySQL Fabric
Netherlands Tech Tour 02 - MySQL Fabric
Mark Swarbrick462 views
SAP on Azure. Use Cases and Benefits von myCloudDoor
SAP on Azure. Use Cases and BenefitsSAP on Azure. Use Cases and Benefits
SAP on Azure. Use Cases and Benefits
myCloudDoor8.4K views
Cloud-native Data: Every Microservice Needs a Cache von cornelia davis
Cloud-native Data: Every Microservice Needs a CacheCloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a Cache
cornelia davis4.4K views
MuleSoft London Community October 2017 - Hybrid and SAP Integration von Pace Integration
MuleSoft London Community October 2017 - Hybrid and SAP IntegrationMuleSoft London Community October 2017 - Hybrid and SAP Integration
MuleSoft London Community October 2017 - Hybrid and SAP Integration
Pace Integration753 views
High Availability of SAP ASCS in Microsoft Azure von Gary Jackson MBCS
High Availability of SAP ASCS in Microsoft AzureHigh Availability of SAP ASCS in Microsoft Azure
High Availability of SAP ASCS in Microsoft Azure
Gary Jackson MBCS1.4K views
WSO2 Intro Webinar - Scale your business with the cloud enabled WSO2 Applica... von WSO2
WSO2 Intro Webinar -  Scale your business with the cloud enabled WSO2 Applica...WSO2 Intro Webinar -  Scale your business with the cloud enabled WSO2 Applica...
WSO2 Intro Webinar - Scale your business with the cloud enabled WSO2 Applica...
WSO2712 views
Микросервисы со Spring Boot & Spring Cloud von Vitebsk DSC
Микросервисы со Spring Boot & Spring CloudМикросервисы со Spring Boot & Spring Cloud
Микросервисы со Spring Boot & Spring Cloud
Vitebsk DSC70 views
Building Applications with the Typesafe Reactive Platform at Skills Matter, L... von Lutz Hühnken
Building Applications with the Typesafe Reactive Platform at Skills Matter, L...Building Applications with the Typesafe Reactive Platform at Skills Matter, L...
Building Applications with the Typesafe Reactive Platform at Skills Matter, L...
Lutz Hühnken479 views
MySQL & Oracle Linux Keynote at Open Source India 2014 von Sanjay Manwani
MySQL & Oracle Linux Keynote at Open Source India 2014MySQL & Oracle Linux Keynote at Open Source India 2014
MySQL & Oracle Linux Keynote at Open Source India 2014
Sanjay Manwani1.2K views
Reference architectures shows a microservices deployed to Kubernetes von Rakesh Gujjarlapudi
Reference architectures shows a microservices deployed to KubernetesReference architectures shows a microservices deployed to Kubernetes
Reference architectures shows a microservices deployed to Kubernetes
Web Scale Reasoning and the LarKC Project von Saltlux Inc.
Web Scale Reasoning and the LarKC ProjectWeb Scale Reasoning and the LarKC Project
Web Scale Reasoning and the LarKC Project
Saltlux Inc.498 views
Stay productive while slicing up the monolith von Markus Eisele
Stay productive while slicing up the monolith Stay productive while slicing up the monolith
Stay productive while slicing up the monolith
Markus Eisele438 views
VMworld 2013: Deploying vSphere with OpenStack: What It Means to Your Cloud E... von VMworld
VMworld 2013: Deploying vSphere with OpenStack: What It Means to Your Cloud E...VMworld 2013: Deploying vSphere with OpenStack: What It Means to Your Cloud E...
VMworld 2013: Deploying vSphere with OpenStack: What It Means to Your Cloud E...
VMworld810 views
Serverless: A love hate relationship von Jürgen Brüder
Serverless: A love hate relationshipServerless: A love hate relationship
Serverless: A love hate relationship
Jürgen Brüder507 views
App Mod 01: Moving existing apps to the cloud von Judy Breedlove
App Mod 01: Moving existing apps to the cloudApp Mod 01: Moving existing apps to the cloud
App Mod 01: Moving existing apps to the cloud
Judy Breedlove927 views

Último

Navigating container technology for enhanced security by Niklas Saari von
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas SaariMetosin Oy
13 views34 Folien
SAP FOR TYRE INDUSTRY.pdf von
SAP FOR TYRE INDUSTRY.pdfSAP FOR TYRE INDUSTRY.pdf
SAP FOR TYRE INDUSTRY.pdfVirendra Rai, PMP
24 views3 Folien
SAP FOR CONTRACT MANUFACTURING.pdf von
SAP FOR CONTRACT MANUFACTURING.pdfSAP FOR CONTRACT MANUFACTURING.pdf
SAP FOR CONTRACT MANUFACTURING.pdfVirendra Rai, PMP
11 views2 Folien
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra... von
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra....NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...Marc Müller
38 views62 Folien
Software testing company in India.pptx von
Software testing company in India.pptxSoftware testing company in India.pptx
Software testing company in India.pptxSakshiPatel82
7 views9 Folien
Tridens DevOps von
Tridens DevOpsTridens DevOps
Tridens DevOpsTridens
9 views28 Folien

Último(20)

Navigating container technology for enhanced security by Niklas Saari von Metosin Oy
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas Saari
Metosin Oy13 views
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra... von Marc Müller
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra....NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
Marc Müller38 views
Software testing company in India.pptx von SakshiPatel82
Software testing company in India.pptxSoftware testing company in India.pptx
Software testing company in India.pptx
SakshiPatel827 views
Tridens DevOps von Tridens
Tridens DevOpsTridens DevOps
Tridens DevOps
Tridens9 views
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx von animuscrm
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
animuscrm14 views
Copilot Prompting Toolkit_All Resources.pdf von Riccardo Zamana
Copilot Prompting Toolkit_All Resources.pdfCopilot Prompting Toolkit_All Resources.pdf
Copilot Prompting Toolkit_All Resources.pdf
Riccardo Zamana8 views
AI and Ml presentation .pptx von FayazAli87
AI and Ml presentation .pptxAI and Ml presentation .pptx
AI and Ml presentation .pptx
FayazAli8711 views
SUGCON ANZ Presentation V2.1 Final.pptx von Jack Spektor
SUGCON ANZ Presentation V2.1 Final.pptxSUGCON ANZ Presentation V2.1 Final.pptx
SUGCON ANZ Presentation V2.1 Final.pptx
Jack Spektor22 views
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t... von Deltares
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...
Deltares9 views
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut... von Deltares
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...
Deltares7 views
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with... von sparkfabrik
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
sparkfabrik5 views
FIMA 2023 Neo4j & FS - Entity Resolution.pptx von Neo4j
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
Neo4j6 views
Headless JS UG Presentation.pptx von Jack Spektor
Headless JS UG Presentation.pptxHeadless JS UG Presentation.pptx
Headless JS UG Presentation.pptx
Jack Spektor7 views
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports von Ra'Fat Al-Msie'deen
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug ReportsBushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports

Microservices OSGi-running-with-apache-karaf

  • 1. Microservices and OSGi running with Apache Karaf
  • 2. •No free Lunch - microservices •microservices or µService? •Free Lunch? - OSGi µServices •µServices in the Apache Karaf ecosystem •https://github.com/ANierbeck/Karaf-Microservices-Tooling •https://github.com/ANierbeck/Karaf-Microservices 2 Agenda Showcase:
  • 3. 3 @anierbeck Senior IT-Consultant @codecentric Apache Karaf PMC Apache Member OPS4j Pax Web Project lead Co-Author Apache Karaf Cookbook
  • 4. No Free Lunch - with micro services_ 4
  • 5. 01 No Free Lunch - with micro services_ Operations overhead Instead of one Application (cluster) micro applications that need to be clustered / Orchestrated / Operated
  • 6. 01 No Free Lunch - with micro services_ DevOps Skills Required old school: One AppServer one application now: applications that might run on different infrastructure Instead of bigger boats, more boats are needed
  • 7. 01 No Free Lunch - with micro services_ Implicit Interfaces Changes in: •syntax •semantics
  • 8. 01 No Free Lunch - with micro services_ Distributed System Complexity network latency fault tolerance message serialization distributed transactions
  • 9. 01 No Free Lunch - with micro services_ A/Synchronicity
 is Difficult! communication is much more asynchronous it gets complex when you need to correlate messages or distributed transactions
  • 10. 01 No Free Lunch - with micro services_ Testability Challenges testing a single service is easy monitoring the dynamic environment is hard —> less testing, more monitoring
  • 11. µService - comparison of two definition_ 11
  • 12. —Peter Kriens, March 2010 http://blog.osgi.org/2010/03/services.html “What I am promoting is the idea of µServices, the concepts of an OSGi service as a design primitive.” 12
  • 13. –Martin Fowler, March 2014 “In short, the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare mininum of centralized management of these services, which may be written in different programming languages and use different data storage technologies.” 13
  • 14. •One main reason for using services as components (rather than libraries) is that services are independently deployable 
 OSGi Bundle •you can expect many single service changes to only require that service to be redeployed
 OSGi Service / Bundle •cohesive service boundaries and evolution mechanisms in the service contracts 
 OSGi Versioning •Often it's only documentation and discipline that prevents clients breaking a component's encapsulation, leading to overly-tight coupling between components.
 OSGi Container enforces this in detail_ 14
  • 15. Free Lunch? OSGi µServices_ 15
  • 16. 01 Free Lunch? OSGi µServices_ Operations Overhead OSGi Bundles - containing services One container vessel One Server to know
  • 18. OSGi Framework 18 JAAS Deployer Console Blueprint LoggingConfig HttpWAR Features Instance OBR KAR JMX JPA JTA Cellar CoreStandardApache Karaf_ JNDI JMS JDBC µServices µServices µServices JAX-RS µServices
  • 19. 01 Free Lunch? OSGi µServices_ DevOps Skills Required requirements are reduced! - Karaf - Ops - OSGi - Devs
  • 20. 01 Free Lunch? OSGi µServices_ Implicit Interfaces semantic versioning OSGi supports multiple versions multiple service implementations tools help
  • 21. 21 Semantic Versioning_ 1. major Packages with versions that have different major parts are not compatible both for providers as well as consumers. For example, 1.2 and 2.3 are completely incompatible. 2. minor API consumers are compatible with exporters that have the same major number and an equal or higher minor version. API providers are compatible with exporters that have the same major and minor version number. For example, 1.2 is backward compatible with 1.1 for consumers but for providers it is incompatible. Consumers should therefore import [1.2,2) and providers should import [1.2,1.3). 3. micro A difference in the micro part does not signal any backward compatibility issues. The micro number is used to fix bugs that do not affect either consumers or providers of the API. 4. qualifier The qualifier is usually used to indicate a build identity, for example a time stamp. Different qualifiers do not signal any backward compatibility issues.
  • 23. 01 Semantic Versioning - Tools_ Release - Baselining Fix version 1.0.0 Baseline new version with 1.0.0 version
  • 24. •Comparing bundle service-api version 1.0.0-SNAPSHOT to version 1.0.0-SNAPSHOT
 PACKAGE_NAME DELTA CUR_VER BASE_VER REC_VER WARNINGS
 = ================================================== ========== ========== ========== ========== ==========
 de.nierbeck.microservices.karaf.calculator unchanged 1.0.0 1.0.0 1.0.0 -
 -----------------------------------------------------------------------------------------------------------
 de.nierbeck.microservices.karaf.calculator.values unchanged 1.0.0 1.0.0 1.0.0 -
 -----------------------------------------------------------------------------------------------------------
 Baseline analysis complete, 0 error(s), 0 warning(s) Semantic Versioning - Baselining_ 24 Baselining
  • 25. 01 Free Lunch? OSGi µServices_ Distributed System Complexity complexity reduced -> one container no network traffic service calls -> method calls from services found in service registry. Clustering: Apache Karaf Cellar Remote: DOSGi —> CXF, Cellar
  • 26. 01 Free Lunch? OSGi µServices_ A/Synchronicity
 is Difficult! in JVM communication service calls - transparent call stateless services event communication Out-Of-The-Box
  • 27. 01 Free Lunch? OSGi µServices_ Testability Challenges POJO tests for business logic Pax EXAM - Integration tests of OSGi services. Shift Focus: More Testing, less monitoring
  • 28. 28 Service tests - Pax EXAM - Continous Integration_
  • 29. µServices in the Apache Karaf ecosystem_ 29
  • 30. 30 µServices in the Apache Karaf ecosystem_ microservices made of µServices …
  • 31. 01 µServices in the Apache Karaf ecosystem_ Apache Karaf Cellar Hazelcast based cluster Groups and Nodes Services across Clusters Failover Load balanced
  • 32. 01 µServices in the Apache Karaf ecosystem_ Apache Karaf Cave OSGi Repository Bundle Requirements Capabilities
  • 33. 01 µServices in the Apache Karaf ecosystem_ Apache Karaf Decanter Monitor Elasticsearch Kibana
  • 34. Continous Delivery with Apache Karaf_ 34
  • 37. µServices - sum of all services_ 37
  • 38. 01 µServices - sum of all services_ Should I do microservices YES! Monolithic blocks are bad Use: - Low Coupling - High Cohesion
  • 39. 01 µServices - sum of all services_ The Silver Bullet? NO! OSGi isn’t the silver Bullet A lot of issues which exist with µ-Services are already solved in the OSGi - Eco system
  • 40. 01 µServices - sum of all services_ Blueprint? YES! Use it as blueprint for transition to microservices OSGi - µServices will help in breaking up the Monolith
  • 41. 01 µServices - sum of all services_ microservice based on µServices instead of building micro-monolith base on OSGi services.
  • 43. •images found at flickr - thanks to that •No Free Lunch with Microservices
 http://highscalability.com/blog/2014/4/8/microservices-not-a- free-lunch.html •http://karaf.apache.org/ •http://blog.osgi.org/2010/03/services.html •https://github.com/ANierbeck/Karaf-Microservices-Tooling •https://github.com/ANierbeck/Karaf-Microservices END_ 43 Links: Showcase:
  • 44. 44