SlideShare a Scribd company logo
#DevoxxUS
Optimizing Enterprise Java
for a Microservices Architecture
John Clingan, middle-aged Java EE guy and MicroProfile-r
Emily Jiang, totally awesome MicroProfile engineer
Eclipse
#DevoxxUS
Agenda
MicroProfile Overview (~10 Minutes)
Example Specs - From concept to implementation (10 minutes)
Collaborate (Until they kick us out or we want to go for a beer)
#DevoxxUS
Enterprise Java Standards History
#DevoxxUS
What is MicroProfile?
A community of individuals, organizations, and vendors …
… collaborating within an open source (Eclipse) project ….
… to bring microservices to the Enterprise Java
community
#DevoxxUS
Innovation vs Standardization
(Open Source) Project Focused Standard (JSR) focused
(Java EE)(MicroProfile)
#DevoxxUS
Innovation vs Standardization
(Open Source) Project Focused Standard (JSR) focused
(Java EE)
Large multi-feature releasesIncremental feature release
(MicroProfile)
#DevoxxUS
Innovation vs Standardization
Spec Lead controls pace
(Open Source) Project Focused Standard (JSR) focused
(Java EE)
Large multi-feature releasesIncremental feature release
(MicroProfile)
Community controls pace
#DevoxxUS
Accelerating* Adoption of MicroServices
2016 2017 2018 2019
8 9
1.0
1.1
1.2
1.3
1.4
2020
1.5
* 2-4 releases per year
#DevoxxUS
MicroProfile 1.0 (Sep, 2016)
Contexts and Dependency Injection (CDI 1.1)
+
Java API for RESTful Web Services (JAX-RS 2.0)
+
Java API for JSON Processing (JSON-P 1.0)
#DevoxxUS
MicroProfile 1.1 Underway
Security: JWT Token Exchange 1.0
Health Check 1.0
Configuration 1.0
Fault Tolerance 1.0 (Stretch goal)
Second Quarter
2017!
#DevoxxUS
Will MicroProfile Features be in Java EE?
Possibly
#DevoxxUS
MicroProfile Java Programming Model
(In Progress)
● Config
● Fault Tolerance
● Health Checker
● Metrics
● Security
#DevoxxUS
Configuration
● Discussed with a formal proposal in the MicroProfile mailing list
(https://groups.google.com/forum/#!topic/microprofile/VJEEAOsVj
5E[26-50])
● After the proposal was accepted, a repository was created to
draft APIs/SPIs (https://github.com/eclipse/microprofile-config/)
#DevoxxUS
MicroProfile Java Prog. Model - Configuration
#DevoxxUS
MicroProfile Java Prog. Model - Configuration
Using CDI Injection
@Inject Config config; Inject all config properties that the class
can see
@Inject
@ConfigProperty(name=“myProp”
defaultValue=“blah”)
String prop1;
Inject the value of the property called
“myProp”. The value of prop1 will not be
refreshed. Suitable for static properties
and used on the RequestScoped beans.
@Inject
@ConfigProperty(name=“myProp”
defaultValue=“blah”)
Provider<String> prop1
Inject the value of the property called
“myProp” and it picks up the dynamic
changes.
#DevoxxUS
MicroProfile Java Prog. Model - Configuration
Programmatic lookup
ConfigProvider.getConfig(); The config object containing all
properties that the class owner can
see.
ConfigProvider.getBuilder()
.addDefaultSources()
.withSources(…).build();
Create a custom config object
#DevoxxUS
MicroProfile Java Prog. Model - Configuration
● The property file, microprofile-config.properties, packaged in the application can be
overwritten by :
○ System variables (400 as the default priority)
○ Environment variables (300 as the default priority) or
○ a custom property files with a higher priority than microprofile-config.properties
(100 as the default priority).
#DevoxxUS
MicroProfile Java Prog. Model - config
● Plan to finalise the current APIs/SPIs and release the Config 1.0
by mid April
● Then work on the new features of Config 1.1
● Join in the Config discussion
● Join in the Config hangout – on Thursdays
#DevoxxUS
MicroProfile Java Prog model –
Fault Tolerance
● Proposal discussion:
https://groups.google.com/forum/#!topic/microprofile/ESs9L3z08o
A
● Prototype (inspired by Failsafe): https://github.com/Emily-
Jiang/microprofile-faultTolerance-incubation
#DevoxxUS
MicroProfile Java Prog model –
Fault Tolerance
Retry The request should have a retry to recover from temporary
glitches
Fallback The request should have a fallback operation if retry fails
Timeout The request must have a timeout, to prevent from waiting
indefinitely
Circuit Breaker The request must prevent from repeating timeouts
Bulkhead One part of application failure must not bring the whole
application down
#DevoxxUS
Fault Tolerance - Fallback Retry
Set up retry policy and wrap the call with the policy and specify
the fallback operation
FaultToleranceFactory.getFaultToleranceType(RetryPolicy.class);
Duration delay = Duration.ofSeconds(1);
retryPolicy =
retryPolicy.retryOn(Exception.class).withDelay(delay)
.withMaxRetries(3);
Runnable fallbackService = () -> serviceB();
executor.with(retryPolicy).withFallback(fallbackService)
.run(mainService);
#DevoxxUS
Fault Tolerance - Circuit Breaker Timeout
Fail-fast, temporarily disable the running of a service
circuitBreaker =
FaultToleranceFactory.getFaultToleranceType(CircuitBreaker.class);
circuitBreaker =
circuitBreaker.withTimeout(timeout).withFailureThreshold(3)
.withSuccessThreshold(2)
.withDelay(delay);
Callable<Object> mainService = () -> serviceA();
Executor executor =
FaultToleranceFactory.getFaultToleranceType(Executor.class);
executor.with(circuitBreaker).get(mainService);
#DevoxxUS
Fault Tolerance - Bulkhead
Limit the number of concurrent calls to a service
ThreadPoolExecutor tpexecutor = new ThreadPoolExecutor(
poolSize, poolSize, 0,
TimeUnit.SECONDS,
new ArrayBlockingQueue<Runnable>(10));
bulkhead = bulkhead.withThread(tpexecutor);
executor.with(bulkhead) .run(mainService);
#DevoxxUS
MicroProfile Java Prog model –
Fault Tolerance
● Non-CDI approach was left out of the first release but focus on CDI-first
approach
● Discussion the CDI-first approach ongoing
● Use Interceptor to apply policy and use annotation to config policy
#DevoxxUS
Health Check, Metrics, Security
● Health Check – proposal accepted
● Metrics and Security – proposal in discussion
#DevoxxUS
Join the Community!
#DevoxxUS
Resources
MicroProfile.io
MicroProfile Discussion Forum
bit.ly/MicroProfileForum
MicroProfile Examples
https://github.com/microprofile/microprofile-samples

More Related Content

PDF
Java 9 and Beyond
PDF
Workflow automation for Front-end web applications
PDF
Testing Your Application On Google App Engine
PDF
BMO - Intelligent Projects with Maven
PDF
Spring - CDI Interop
PDF
基於 Flow & Path 的 MVP 架構
PDF
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
PDF
Apache DeltaSpike the CDI toolbox
Java 9 and Beyond
Workflow automation for Front-end web applications
Testing Your Application On Google App Engine
BMO - Intelligent Projects with Maven
Spring - CDI Interop
基於 Flow & Path 的 MVP 架構
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
Apache DeltaSpike the CDI toolbox

What's hot (20)

PDF
Testing with JUnit 5 and Spring
PDF
Intelligent Projects with Maven - DevFest Istanbul
PDF
Introduction maven3 and gwt2.5 rc2 - Lesson 01
PPTX
Devops interview questions 1 www.bigclasses.com
PDF
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
PDF
Apache DeltaSpike
PDF
OpenWebBeans and DeltaSpike at ApacheCon
PDF
Android MvRx Framework 介紹
PDF
vJUG - The JavaFX Ecosystem
PPTX
Automated Infrastructure Testing
PDF
Java EE Microservices
PDF
DI with Dagger2
PPT
Jenkins Scriptler in 90mins
PPTX
Ci jenkins maven svn
PDF
1/3 : introduction to CDI - Antoine Sabot-Durand
PDF
What is new in JUnit5
PDF
RIBs - Fragments which work
PPTX
Introduction to Spring Boot
PDF
Developing modern java web applications with java ee 7 and angular js
PPTX
Spring Testing, Fight for the Context
Testing with JUnit 5 and Spring
Intelligent Projects with Maven - DevFest Istanbul
Introduction maven3 and gwt2.5 rc2 - Lesson 01
Devops interview questions 1 www.bigclasses.com
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
Apache DeltaSpike
OpenWebBeans and DeltaSpike at ApacheCon
Android MvRx Framework 介紹
vJUG - The JavaFX Ecosystem
Automated Infrastructure Testing
Java EE Microservices
DI with Dagger2
Jenkins Scriptler in 90mins
Ci jenkins maven svn
1/3 : introduction to CDI - Antoine Sabot-Durand
What is new in JUnit5
RIBs - Fragments which work
Introduction to Spring Boot
Developing modern java web applications with java ee 7 and angular js
Spring Testing, Fight for the Context
Ad

Similar to Eclipse MicroProfile: Accelerating the adoption of Java Microservices (20)

PDF
MicroProfile Devoxx.us
PPTX
MicroProfile: A Quest for a Lightweight and Modern Enterprise Java Platform
PDF
MicroProfile: Optimizing Java EE for a Microservices Architecture
PDF
MicroProfile Panel - Sept 2016
PPTX
Eclipse micro profile
PPTX
Introduction to Eclipse Microprofile
PDF
Creando microservicios con java micro profile y tomee - CUNORI 2020
PDF
Dublin JUG Lightweight Microservices with Microprofile and Raspberry PIs
PPTX
Building 12-factor Cloud Native Microservices
PDF
Live Coding 12 Factor App
PPTX
Cloud nativemicroservices jax-london2020
PPTX
Cloud nativemicroservices jax-london2020
PPTX
Boost developer productivity with EE, MP and OL (Devoxx Ukraine 22).pptx
PPTX
Master a Cloud Native Standard - MicroProfile.pptx
PDF
MicroProfile
PDF
Master a Cloud Native Standard - MicroProfile.pdf
PDF
Master a Cloud Native Standard - MicroProfile.pdf
PDF
MicroProfile for MicroServices
PPTX
Hands-on cloud-native Java with MicroProfile, Kubernetes and Istio at Javantura
PPTX
Cloud native programming model comparison
MicroProfile Devoxx.us
MicroProfile: A Quest for a Lightweight and Modern Enterprise Java Platform
MicroProfile: Optimizing Java EE for a Microservices Architecture
MicroProfile Panel - Sept 2016
Eclipse micro profile
Introduction to Eclipse Microprofile
Creando microservicios con java micro profile y tomee - CUNORI 2020
Dublin JUG Lightweight Microservices with Microprofile and Raspberry PIs
Building 12-factor Cloud Native Microservices
Live Coding 12 Factor App
Cloud nativemicroservices jax-london2020
Cloud nativemicroservices jax-london2020
Boost developer productivity with EE, MP and OL (Devoxx Ukraine 22).pptx
Master a Cloud Native Standard - MicroProfile.pptx
MicroProfile
Master a Cloud Native Standard - MicroProfile.pdf
Master a Cloud Native Standard - MicroProfile.pdf
MicroProfile for MicroServices
Hands-on cloud-native Java with MicroProfile, Kubernetes and Istio at Javantura
Cloud native programming model comparison
Ad

More from Dev_Events (20)

PPTX
Eclipse OMR: a modern, open-source toolkit for building language runtimes
PPTX
From Science Fiction to Science Fact: How AI Will Change Our Approach to Buil...
PDF
Blockchain Hyperledger Lab
PDF
Introduction to Blockchain and Hyperledger
PDF
Using GPUs to Achieve Massive Parallelism in Java 8
PDF
Lean and Easy IoT Applications with OSGi and Eclipse Concierge
PDF
Eclipse JDT Embraces Java 9 – An Insider’s View
PDF
Node.js – ask us anything!
PDF
Swift on the Server
PDF
Being serverless and Swift... Is that allowed?
PPTX
Secrets of building a debuggable runtime: Learn how language implementors sol...
PPTX
Tools in Action: Transforming everyday objects with the power of deeplearning...
PDF
Microservices without Servers
PDF
The App Evolution
PDF
Building Next Generation Applications and Microservices
PDF
Create and Manage APIs with API Connect, Swagger and Bluemix
PDF
OpenWhisk - Serverless Architecture
PDF
Add Custom Model and ORM to Node.js
PDF
Adding User Management to Node.js
PDF
Creating Sentiment Line Chart with Watson
Eclipse OMR: a modern, open-source toolkit for building language runtimes
From Science Fiction to Science Fact: How AI Will Change Our Approach to Buil...
Blockchain Hyperledger Lab
Introduction to Blockchain and Hyperledger
Using GPUs to Achieve Massive Parallelism in Java 8
Lean and Easy IoT Applications with OSGi and Eclipse Concierge
Eclipse JDT Embraces Java 9 – An Insider’s View
Node.js – ask us anything!
Swift on the Server
Being serverless and Swift... Is that allowed?
Secrets of building a debuggable runtime: Learn how language implementors sol...
Tools in Action: Transforming everyday objects with the power of deeplearning...
Microservices without Servers
The App Evolution
Building Next Generation Applications and Microservices
Create and Manage APIs with API Connect, Swagger and Bluemix
OpenWhisk - Serverless Architecture
Add Custom Model and ORM to Node.js
Adding User Management to Node.js
Creating Sentiment Line Chart with Watson

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Network Security Unit 5.pdf for BCA BBA.
PPT
Teaching material agriculture food technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
cuic standard and advanced reporting.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
MYSQL Presentation for SQL database connectivity
Understanding_Digital_Forensics_Presentation.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Empathic Computing: Creating Shared Understanding
Network Security Unit 5.pdf for BCA BBA.
Teaching material agriculture food technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
NewMind AI Weekly Chronicles - August'25 Week I
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Dropbox Q2 2025 Financial Results & Investor Presentation
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Spectral efficient network and resource selection model in 5G networks
Programs and apps: productivity, graphics, security and other tools
Advanced methodologies resolving dimensionality complications for autism neur...
Chapter 3 Spatial Domain Image Processing.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

Eclipse MicroProfile: Accelerating the adoption of Java Microservices

  • 1. #DevoxxUS Optimizing Enterprise Java for a Microservices Architecture John Clingan, middle-aged Java EE guy and MicroProfile-r Emily Jiang, totally awesome MicroProfile engineer Eclipse
  • 2. #DevoxxUS Agenda MicroProfile Overview (~10 Minutes) Example Specs - From concept to implementation (10 minutes) Collaborate (Until they kick us out or we want to go for a beer)
  • 4. #DevoxxUS What is MicroProfile? A community of individuals, organizations, and vendors … … collaborating within an open source (Eclipse) project …. … to bring microservices to the Enterprise Java community
  • 5. #DevoxxUS Innovation vs Standardization (Open Source) Project Focused Standard (JSR) focused (Java EE)(MicroProfile)
  • 6. #DevoxxUS Innovation vs Standardization (Open Source) Project Focused Standard (JSR) focused (Java EE) Large multi-feature releasesIncremental feature release (MicroProfile)
  • 7. #DevoxxUS Innovation vs Standardization Spec Lead controls pace (Open Source) Project Focused Standard (JSR) focused (Java EE) Large multi-feature releasesIncremental feature release (MicroProfile) Community controls pace
  • 8. #DevoxxUS Accelerating* Adoption of MicroServices 2016 2017 2018 2019 8 9 1.0 1.1 1.2 1.3 1.4 2020 1.5 * 2-4 releases per year
  • 9. #DevoxxUS MicroProfile 1.0 (Sep, 2016) Contexts and Dependency Injection (CDI 1.1) + Java API for RESTful Web Services (JAX-RS 2.0) + Java API for JSON Processing (JSON-P 1.0)
  • 10. #DevoxxUS MicroProfile 1.1 Underway Security: JWT Token Exchange 1.0 Health Check 1.0 Configuration 1.0 Fault Tolerance 1.0 (Stretch goal) Second Quarter 2017!
  • 11. #DevoxxUS Will MicroProfile Features be in Java EE? Possibly
  • 12. #DevoxxUS MicroProfile Java Programming Model (In Progress) ● Config ● Fault Tolerance ● Health Checker ● Metrics ● Security
  • 13. #DevoxxUS Configuration ● Discussed with a formal proposal in the MicroProfile mailing list (https://groups.google.com/forum/#!topic/microprofile/VJEEAOsVj 5E[26-50]) ● After the proposal was accepted, a repository was created to draft APIs/SPIs (https://github.com/eclipse/microprofile-config/)
  • 14. #DevoxxUS MicroProfile Java Prog. Model - Configuration
  • 15. #DevoxxUS MicroProfile Java Prog. Model - Configuration Using CDI Injection @Inject Config config; Inject all config properties that the class can see @Inject @ConfigProperty(name=“myProp” defaultValue=“blah”) String prop1; Inject the value of the property called “myProp”. The value of prop1 will not be refreshed. Suitable for static properties and used on the RequestScoped beans. @Inject @ConfigProperty(name=“myProp” defaultValue=“blah”) Provider<String> prop1 Inject the value of the property called “myProp” and it picks up the dynamic changes.
  • 16. #DevoxxUS MicroProfile Java Prog. Model - Configuration Programmatic lookup ConfigProvider.getConfig(); The config object containing all properties that the class owner can see. ConfigProvider.getBuilder() .addDefaultSources() .withSources(…).build(); Create a custom config object
  • 17. #DevoxxUS MicroProfile Java Prog. Model - Configuration ● The property file, microprofile-config.properties, packaged in the application can be overwritten by : ○ System variables (400 as the default priority) ○ Environment variables (300 as the default priority) or ○ a custom property files with a higher priority than microprofile-config.properties (100 as the default priority).
  • 18. #DevoxxUS MicroProfile Java Prog. Model - config ● Plan to finalise the current APIs/SPIs and release the Config 1.0 by mid April ● Then work on the new features of Config 1.1 ● Join in the Config discussion ● Join in the Config hangout – on Thursdays
  • 19. #DevoxxUS MicroProfile Java Prog model – Fault Tolerance ● Proposal discussion: https://groups.google.com/forum/#!topic/microprofile/ESs9L3z08o A ● Prototype (inspired by Failsafe): https://github.com/Emily- Jiang/microprofile-faultTolerance-incubation
  • 20. #DevoxxUS MicroProfile Java Prog model – Fault Tolerance Retry The request should have a retry to recover from temporary glitches Fallback The request should have a fallback operation if retry fails Timeout The request must have a timeout, to prevent from waiting indefinitely Circuit Breaker The request must prevent from repeating timeouts Bulkhead One part of application failure must not bring the whole application down
  • 21. #DevoxxUS Fault Tolerance - Fallback Retry Set up retry policy and wrap the call with the policy and specify the fallback operation FaultToleranceFactory.getFaultToleranceType(RetryPolicy.class); Duration delay = Duration.ofSeconds(1); retryPolicy = retryPolicy.retryOn(Exception.class).withDelay(delay) .withMaxRetries(3); Runnable fallbackService = () -> serviceB(); executor.with(retryPolicy).withFallback(fallbackService) .run(mainService);
  • 22. #DevoxxUS Fault Tolerance - Circuit Breaker Timeout Fail-fast, temporarily disable the running of a service circuitBreaker = FaultToleranceFactory.getFaultToleranceType(CircuitBreaker.class); circuitBreaker = circuitBreaker.withTimeout(timeout).withFailureThreshold(3) .withSuccessThreshold(2) .withDelay(delay); Callable<Object> mainService = () -> serviceA(); Executor executor = FaultToleranceFactory.getFaultToleranceType(Executor.class); executor.with(circuitBreaker).get(mainService);
  • 23. #DevoxxUS Fault Tolerance - Bulkhead Limit the number of concurrent calls to a service ThreadPoolExecutor tpexecutor = new ThreadPoolExecutor( poolSize, poolSize, 0, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(10)); bulkhead = bulkhead.withThread(tpexecutor); executor.with(bulkhead) .run(mainService);
  • 24. #DevoxxUS MicroProfile Java Prog model – Fault Tolerance ● Non-CDI approach was left out of the first release but focus on CDI-first approach ● Discussion the CDI-first approach ongoing ● Use Interceptor to apply policy and use annotation to config policy
  • 25. #DevoxxUS Health Check, Metrics, Security ● Health Check – proposal accepted ● Metrics and Security – proposal in discussion
  • 27. #DevoxxUS Resources MicroProfile.io MicroProfile Discussion Forum bit.ly/MicroProfileForum MicroProfile Examples https://github.com/microprofile/microprofile-samples

Editor's Notes

  • #4: Java EE has been an extremely successful platform. The JCP has been the steward of over 20 compatible implementations over its nearly 20 year history, resulting in a $4B industry. These are just some of the Java EE compatible implementations that exist. In its early stages, J2EE grew somewhat quickly (perhaps too quickly) as the platform needed to address the immediate needs of the enterprise. Beginning with Java EE 5 in 2006, the pace began to slow as the platform began to mature. Java EE is now following the slower release cadence that a standards organization typically reflects. A standards-based release cadence by design does not address ew and rapid innovations.
  • #11: MicroProfile 1.1 is underway, and scheduled for the 2nd quarter of 2017. The community has decided to focus this release on Configuration, Security (JWT Token Exchange), Health Check, and Fault Tolerance. Configuration: Separates (externalizes) a microservice from its configuration. Health Check: Specifies a REST endpoint with service health information. Enables cloud infrastructure to detect the health of a service. If a service is unhealthy, a cloud runtime can restart (or fail and re-create) a service instance Fault Tolerance: APIs that cover popular microservice programming patterns, including Fallback, Circuit Breakers, and Bulkheads