SlideShare une entreprise Scribd logo
1  sur  21
Microservices with JEE
Best Practices and a Close Look using
WebSphere Liberty Profile
Michael Hofmann, ARS Computer und Consulting GmbH
and
Erin Schnabel, IBM
IBM InterConnect 2017 Conference (Session ID: BMC-4741)
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
2
IBM Redbook
Motivation
market interest
missing literature about
microservices
with Java showing best practices
even less literature on
microservices with Java EE
Target
Microservices with Java and
Java EE from development
to production
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
3
Twelve factor applications
“A methodology for building
software-as-a-service applications”
Factors are independent of
 programming language
 backing services
 cloud provider
http://12factor.net/
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
4
Factor 2 - Dependencies
Key points:
 App declares all dependencies
 App doesn’t rely on “pre-requisite”
system-wide packages
 use dependency isolation tool (build
time, e.g. Gradle)
Runtime aspect:
 Liberty Features declared in
server.xml
 Package application with Liberty
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
5
Factor 3 - Config
Key points:
 Config includes anything that
can vary between deploys
 does not include internal
application config
Liberty:
 central config file
 can be managed in source
repository (scm)
 dynamic reload
 JNDI variables
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
6
Factor 4 - Backing Services
Key points:
Backing services
e.g. Datastore, Watson, ….
Resources can be
attached and detached at will
Java and Java EE support a lot
of different backing services…
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
7
Backing Service
Polyglot Persistence
 SQL
 NoSQL
Messaging Systems
 Java Messaging System (JMS) Client
 AMQP
 MQTT
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
8
Factor 5 – Build, Release, Run
Key points:
strict separation between
stages: Build, Release, Run
e.g. no code changes at runtime
The Liberty way:
Build pipeline!
Git commit to master -> build -> live!
Liberty in docker container
Liberty own packaging feature
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
9
Package … deploy … config
One single executable JAR file
 Spring Boot
 Wildfly Swarm (JBoss)
 IBM WebSphere Liberty
All alternatives
 Application together with
 external configuration (immutable artifact) and
 necessary runtime
 in minimalised form
 augmented with functions for metrics and health care
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
10
Factor 8 - Concurrency
Key points:
Recommends splitting processes
based on the type of work
Scale by making more processes
Liberty supports:
Autoscaling
Dynamic Routing
Cluster
Elasticity
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
11
Scalability
 Core characteristic of a microservice
 Better when microservices scale automatically
 Disadvantage of static provisioning
 Spring Boot und Wildfly Swarm depend on infrastructure
 Liberty has additional features
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
12
Liberty features for Scalability
 Fast startup time
 Low memory footprint
 IBM supports Liberty in a docker container
 Liberty Collectives and Cluster with Autoscaling und Dynamic-
Routing
Automatic scaling with Liberty exclusive features possible!
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
13
IBM WAS Liberty Collective
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
14
IBM WAS Liberty Collective with Dynamic Routing
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
15
Liberty elasticity
Scaling Controller installs new Liberty servers
Minimal installation package
(server + app)
Host leader
 communicates with Scaling Controller
 monitors workload
 informs members about commands from Scaling Controller
Polyglot environments
 StrongLoop server
 Liberty server
 Liberty Docker containers
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
16
Factor 11 - Logs
Key points:
A 12-factor app never concerns
itself with routing or storage of
its output stream
Process streams are captured
by the execution environment
Usage of:
Liberty feature for ELK-Stack
Create correlation-ID with UUID
to track calls across service
boundaries
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
17
Factor 12 – Admin processes
Key points:
Keep admin task code with
application code
Run admin tasks in an identical
environment to the app
 Run against a “Release”
/ Same config
Same dependency isolation:
 gradlew
 bundle exec
 python virtualenv
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
18
Liberty Monitoring/Administration
Liberty feature: monitor-1.0
 Collects performance data at runtime
 Accessible with JMX or REST
 Liberty feature: adminCenter-1.0
 Admin-Web-Client:
 used heap memory
 loaded classes
 active JVM threads
 CPU usage
 other metrics, depending on resource
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
19
High demands on prod stage
 Liberty healthManager-1.0 and healthAnalyzer-1.0
 Max. percent of request timeouts and max. response time
 Intense memory consumption
 Potential Memory-Leaks
 Results in the following actions:
 Server restart
 Create Heap or Thread Dump
 Toggle server to Maintenance Mode
 Executed on:
Host, Cluster or Server
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
20
http://MicroProfile.io
© ARS Computer und Consulting GmbH 2017
Microservices with JEE
21
Contact information
Michael Hofmann, ARS Computer und Consulting GmbH
michael.hofmann@ars.de
www.ars.de
Erin Schnabel, IBM
schnabel@us.ibm.com
Twitter: @ebullientworks

Contenu connexe

Plus de Michael Hofmann

Plus de Michael Hofmann (6)

Servicierung von Monolithen - Der Weg zu neuen Technologien bis hin zum Servi...
Servicierung von Monolithen - Der Weg zu neuen Technologien bis hin zum Servi...Servicierung von Monolithen - Der Weg zu neuen Technologien bis hin zum Servi...
Servicierung von Monolithen - Der Weg zu neuen Technologien bis hin zum Servi...
 
Service Mesh mit Istio und MicroProfile - eine harmonische Kombination?
Service Mesh mit Istio und MicroProfile - eine harmonische Kombination?Service Mesh mit Istio und MicroProfile - eine harmonische Kombination?
Service Mesh mit Istio und MicroProfile - eine harmonische Kombination?
 
Service Mesh - kilometer 30 in a microservice marathon
Service Mesh - kilometer 30 in a microservice marathonService Mesh - kilometer 30 in a microservice marathon
Service Mesh - kilometer 30 in a microservice marathon
 
Service Mesh - Kilometer 30 im Microservices-Marathon
Service Mesh - Kilometer 30 im Microservices-MarathonService Mesh - Kilometer 30 im Microservices-Marathon
Service Mesh - Kilometer 30 im Microservices-Marathon
 
API-Economy bei Financial Services – Kein Stein bleibt auf dem anderen
API-Economy bei Financial Services – Kein Stein bleibt auf dem anderenAPI-Economy bei Financial Services – Kein Stein bleibt auf dem anderen
API-Economy bei Financial Services – Kein Stein bleibt auf dem anderen
 
Microservices mit Java EE - am Beispiel von IBM Liberty
Microservices mit Java EE - am Beispiel von IBM LibertyMicroservices mit Java EE - am Beispiel von IBM Liberty
Microservices mit Java EE - am Beispiel von IBM Liberty
 

Dernier

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Dernier (20)

WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 

Microservices with JEE - Best Practices and a Close Look using WebSphere Liberty Profile

  • 1. Microservices with JEE Best Practices and a Close Look using WebSphere Liberty Profile Michael Hofmann, ARS Computer und Consulting GmbH and Erin Schnabel, IBM IBM InterConnect 2017 Conference (Session ID: BMC-4741)
  • 2. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 2 IBM Redbook Motivation market interest missing literature about microservices with Java showing best practices even less literature on microservices with Java EE Target Microservices with Java and Java EE from development to production
  • 3. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 3 Twelve factor applications “A methodology for building software-as-a-service applications” Factors are independent of  programming language  backing services  cloud provider http://12factor.net/
  • 4. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 4 Factor 2 - Dependencies Key points:  App declares all dependencies  App doesn’t rely on “pre-requisite” system-wide packages  use dependency isolation tool (build time, e.g. Gradle) Runtime aspect:  Liberty Features declared in server.xml  Package application with Liberty
  • 5. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 5 Factor 3 - Config Key points:  Config includes anything that can vary between deploys  does not include internal application config Liberty:  central config file  can be managed in source repository (scm)  dynamic reload  JNDI variables
  • 6. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 6 Factor 4 - Backing Services Key points: Backing services e.g. Datastore, Watson, …. Resources can be attached and detached at will Java and Java EE support a lot of different backing services…
  • 7. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 7 Backing Service Polyglot Persistence  SQL  NoSQL Messaging Systems  Java Messaging System (JMS) Client  AMQP  MQTT
  • 8. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 8 Factor 5 – Build, Release, Run Key points: strict separation between stages: Build, Release, Run e.g. no code changes at runtime The Liberty way: Build pipeline! Git commit to master -> build -> live! Liberty in docker container Liberty own packaging feature
  • 9. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 9 Package … deploy … config One single executable JAR file  Spring Boot  Wildfly Swarm (JBoss)  IBM WebSphere Liberty All alternatives  Application together with  external configuration (immutable artifact) and  necessary runtime  in minimalised form  augmented with functions for metrics and health care
  • 10. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 10 Factor 8 - Concurrency Key points: Recommends splitting processes based on the type of work Scale by making more processes Liberty supports: Autoscaling Dynamic Routing Cluster Elasticity
  • 11. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 11 Scalability  Core characteristic of a microservice  Better when microservices scale automatically  Disadvantage of static provisioning  Spring Boot und Wildfly Swarm depend on infrastructure  Liberty has additional features
  • 12. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 12 Liberty features for Scalability  Fast startup time  Low memory footprint  IBM supports Liberty in a docker container  Liberty Collectives and Cluster with Autoscaling und Dynamic- Routing Automatic scaling with Liberty exclusive features possible!
  • 13. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 13 IBM WAS Liberty Collective
  • 14. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 14 IBM WAS Liberty Collective with Dynamic Routing
  • 15. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 15 Liberty elasticity Scaling Controller installs new Liberty servers Minimal installation package (server + app) Host leader  communicates with Scaling Controller  monitors workload  informs members about commands from Scaling Controller Polyglot environments  StrongLoop server  Liberty server  Liberty Docker containers
  • 16. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 16 Factor 11 - Logs Key points: A 12-factor app never concerns itself with routing or storage of its output stream Process streams are captured by the execution environment Usage of: Liberty feature for ELK-Stack Create correlation-ID with UUID to track calls across service boundaries
  • 17. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 17 Factor 12 – Admin processes Key points: Keep admin task code with application code Run admin tasks in an identical environment to the app  Run against a “Release” / Same config Same dependency isolation:  gradlew  bundle exec  python virtualenv
  • 18. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 18 Liberty Monitoring/Administration Liberty feature: monitor-1.0  Collects performance data at runtime  Accessible with JMX or REST  Liberty feature: adminCenter-1.0  Admin-Web-Client:  used heap memory  loaded classes  active JVM threads  CPU usage  other metrics, depending on resource
  • 19. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 19 High demands on prod stage  Liberty healthManager-1.0 and healthAnalyzer-1.0  Max. percent of request timeouts and max. response time  Intense memory consumption  Potential Memory-Leaks  Results in the following actions:  Server restart  Create Heap or Thread Dump  Toggle server to Maintenance Mode  Executed on: Host, Cluster or Server
  • 20. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 20 http://MicroProfile.io
  • 21. © ARS Computer und Consulting GmbH 2017 Microservices with JEE 21 Contact information Michael Hofmann, ARS Computer und Consulting GmbH michael.hofmann@ars.de www.ars.de Erin Schnabel, IBM schnabel@us.ibm.com Twitter: @ebullientworks