SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Downloaden Sie, um offline zu lesen
#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-incubat
ion
#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

Weitere ähnliche Inhalte

Was ist angesagt?

JPQL/ JPA Activity 1
JPQL/ JPA Activity 1JPQL/ JPA Activity 1
JPQL/ JPA Activity 1
SFI
 
Developing modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular jsDeveloping modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular js
Shekhar Gulati
 
Preventing Supply Chain Attacks on Open Source Software
Preventing Supply Chain Attacks on Open Source SoftwarePreventing Supply Chain Attacks on Open Source Software
Preventing Supply Chain Attacks on Open Source Software
All Things Open
 

Was ist angesagt? (20)

Java Technology Trends
Java Technology TrendsJava Technology Trends
Java Technology Trends
 
Spring Framework 5.0: Hidden Gems
Spring Framework 5.0: Hidden GemsSpring Framework 5.0: Hidden Gems
Spring Framework 5.0: Hidden Gems
 
Wellington MuleSoft Meetup 2021-02-18
Wellington MuleSoft Meetup 2021-02-18Wellington MuleSoft Meetup 2021-02-18
Wellington MuleSoft Meetup 2021-02-18
 
Introduction to Continuous Integration
Introduction to Continuous IntegrationIntroduction to Continuous Integration
Introduction to Continuous Integration
 
Jakarta EE: Today and Tomorrow
Jakarta EE: Today and TomorrowJakarta EE: Today and Tomorrow
Jakarta EE: Today and Tomorrow
 
Running Spring Boot Applications as GraalVM Native Images
Running Spring Boot Applications as GraalVM Native ImagesRunning Spring Boot Applications as GraalVM Native Images
Running Spring Boot Applications as GraalVM Native Images
 
Continuous integration and delivery for java based web applications
Continuous integration and delivery for java based web applicationsContinuous integration and delivery for java based web applications
Continuous integration and delivery for java based web applications
 
Android with dagger_2
Android with dagger_2Android with dagger_2
Android with dagger_2
 
Going Serverless Using the Spring Framework Ecosystem
Going Serverless Using the Spring Framework EcosystemGoing Serverless Using the Spring Framework Ecosystem
Going Serverless Using the Spring Framework Ecosystem
 
The Path Towards Spring Boot Native Applications
The Path Towards Spring Boot Native ApplicationsThe Path Towards Spring Boot Native Applications
The Path Towards Spring Boot Native Applications
 
Effective Spring on Kubernetes
Effective Spring on KubernetesEffective Spring on Kubernetes
Effective Spring on Kubernetes
 
Java 9 Modularity in Action
Java 9 Modularity in ActionJava 9 Modularity in Action
Java 9 Modularity in Action
 
JPQL/ JPA Activity 1
JPQL/ JPA Activity 1JPQL/ JPA Activity 1
JPQL/ JPA Activity 1
 
QCon SF 2017 - Microservices: Service-Oriented Development
QCon SF 2017 - Microservices: Service-Oriented DevelopmentQCon SF 2017 - Microservices: Service-Oriented Development
QCon SF 2017 - Microservices: Service-Oriented Development
 
Developing modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular jsDeveloping modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular js
 
Grails 4: Upgrade your Game!
Grails 4: Upgrade your Game!Grails 4: Upgrade your Game!
Grails 4: Upgrade your Game!
 
Building Big Architectures XP Conference 2016
Building Big Architectures XP Conference 2016Building Big Architectures XP Conference 2016
Building Big Architectures XP Conference 2016
 
Preventing Supply Chain Attacks on Open Source Software
Preventing Supply Chain Attacks on Open Source SoftwarePreventing Supply Chain Attacks on Open Source Software
Preventing Supply Chain Attacks on Open Source Software
 
Javantura v4 - Security architecture of the Java platform - Martin Toshev
Javantura v4 - Security architecture of the Java platform - Martin ToshevJavantura v4 - Security architecture of the Java platform - Martin Toshev
Javantura v4 - Security architecture of the Java platform - Martin Toshev
 
Developing Web Application Using J2EE - Nex
Developing Web Application Using J2EE - NexDeveloping Web Application Using J2EE - Nex
Developing Web Application Using J2EE - Nex
 

Andere mochten auch

Andere mochten auch (20)

MicroProfile
MicroProfileMicroProfile
MicroProfile
 
株式会社Loco Partners会社概要 v1.0
株式会社Loco Partners会社概要 v1.0株式会社Loco Partners会社概要 v1.0
株式会社Loco Partners会社概要 v1.0
 
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
 
Microservices - firststatedot.net - 13-oct-15
Microservices - firststatedot.net - 13-oct-15Microservices - firststatedot.net - 13-oct-15
Microservices - firststatedot.net - 13-oct-15
 
Cloud Security
Cloud Security Cloud Security
Cloud Security
 
Writing Java EE microservices using WildFly Swarm
Writing Java EE microservices using WildFly SwarmWriting Java EE microservices using WildFly Swarm
Writing Java EE microservices using WildFly Swarm
 
CDI 2.0 is upon us Devoxx
CDI 2.0 is upon us DevoxxCDI 2.0 is upon us Devoxx
CDI 2.0 is upon us Devoxx
 
HTTP/2 in Examples
HTTP/2 in ExamplesHTTP/2 in Examples
HTTP/2 in Examples
 
Lagom, reactive framework(chtijug2016)
Lagom, reactive framework(chtijug2016) Lagom, reactive framework(chtijug2016)
Lagom, reactive framework(chtijug2016)
 
Spring Cloud Contract And Your Microservice Architecture
Spring Cloud Contract And Your Microservice ArchitectureSpring Cloud Contract And Your Microservice Architecture
Spring Cloud Contract And Your Microservice Architecture
 
Intro to AWS Machine Learning
Intro to AWS Machine LearningIntro to AWS Machine Learning
Intro to AWS Machine Learning
 
Apache Spark An Overview
Apache Spark An OverviewApache Spark An Overview
Apache Spark An Overview
 
Lagom : Reactive microservice framework
Lagom : Reactive microservice frameworkLagom : Reactive microservice framework
Lagom : Reactive microservice framework
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
 
Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureConsumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice Architecture
 
IoT, APIs und Microservices - alles unter Node-RED
IoT, APIs und Microservices - alles unter Node-REDIoT, APIs und Microservices - alles unter Node-RED
IoT, APIs und Microservices - alles unter Node-RED
 
Selecting the right cache framework
Selecting the right cache frameworkSelecting the right cache framework
Selecting the right cache framework
 
Concourse CI meetup-2017-03-24
Concourse CI meetup-2017-03-24Concourse CI meetup-2017-03-24
Concourse CI meetup-2017-03-24
 
Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"
Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"
Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"
 
Devoxx2017
Devoxx2017Devoxx2017
Devoxx2017
 

Ähnlich wie MicroProfile Devoxx.us

Apache DeltaSpike
Apache DeltaSpikeApache DeltaSpike
Apache DeltaSpike
os890
 

Ähnlich wie MicroProfile Devoxx.us (20)

Eclipse MicroProfile: Accelerating the adoption of Java Microservices
Eclipse MicroProfile: Accelerating the adoption of Java MicroservicesEclipse MicroProfile: Accelerating the adoption of Java Microservices
Eclipse MicroProfile: Accelerating the adoption of Java Microservices
 
Level Up Your Integration Testing With Testcontainers
Level Up Your Integration Testing With TestcontainersLevel Up Your Integration Testing With Testcontainers
Level Up Your Integration Testing With Testcontainers
 
Apache DeltaSpike
Apache DeltaSpikeApache DeltaSpike
Apache DeltaSpike
 
Angular or Backbone: Go Mobile!
Angular or Backbone: Go Mobile!Angular or Backbone: Go Mobile!
Angular or Backbone: Go Mobile!
 
Mutation Testing DevoxxUK 2021
Mutation Testing DevoxxUK 2021Mutation Testing DevoxxUK 2021
Mutation Testing DevoxxUK 2021
 
Android App Architecture with modern libs in practice. Our way in R.I.D., Ser...
Android App Architecture with modern libs in practice. Our way in R.I.D., Ser...Android App Architecture with modern libs in practice. Our way in R.I.D., Ser...
Android App Architecture with modern libs in practice. Our way in R.I.D., Ser...
 
Improve unit tests with Mutants!
Improve unit tests with Mutants!Improve unit tests with Mutants!
Improve unit tests with Mutants!
 
Advanced Java Testing
Advanced Java TestingAdvanced Java Testing
Advanced Java Testing
 
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
 
What's new in java 9?
What's new in java 9?What's new in java 9?
What's new in java 9?
 
Introduction to Eclipse Microprofile
Introduction to Eclipse MicroprofileIntroduction to Eclipse Microprofile
Introduction to Eclipse Microprofile
 
Containers: DevOp Enablers of Technical Solutions
Containers: DevOp Enablers of Technical SolutionsContainers: DevOp Enablers of Technical Solutions
Containers: DevOp Enablers of Technical Solutions
 
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO ExtendedJetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO Extended
 
The State of Java under Oracle at JCertif 2011
The State of Java under Oracle at JCertif 2011The State of Java under Oracle at JCertif 2011
The State of Java under Oracle at JCertif 2011
 
Java EE Revisits GoF Design Patterns
Java EE Revisits GoF Design PatternsJava EE Revisits GoF Design Patterns
Java EE Revisits GoF Design Patterns
 
Live Coding 12 Factor App
Live Coding 12 Factor AppLive Coding 12 Factor App
Live Coding 12 Factor App
 
New types of tests for Java projects
New types of tests for Java projectsNew types of tests for Java projects
New types of tests for Java projects
 
Toolbox for Selenium Tests in Java: WebDriverManager and Selenium-Jupiter
Toolbox for Selenium Tests in Java: WebDriverManager and Selenium-JupiterToolbox for Selenium Tests in Java: WebDriverManager and Selenium-Jupiter
Toolbox for Selenium Tests in Java: WebDriverManager and Selenium-Jupiter
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
159747608 a-training-report-on
159747608 a-training-report-on159747608 a-training-report-on
159747608 a-training-report-on
 

Kürzlich hochgeladen

%+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
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
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
 

Kürzlich hochgeladen (20)

%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%+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...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
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
 
%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
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
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
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 

MicroProfile Devoxx.us

  • 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-incubat ion
  • 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