SlideShare a Scribd company logo
1 of 43
@croft#Devoxx #MicroProfile
Eclipse MicroProfile:
A Quest for a Lightweight and Modern Enterprise Java Platform
Mike Croft
Payara
@croft#Devoxx #MicroProfile
The Quest
• What is MicroProfile?
• Why MicroProfile?
• How do I get it?
• What APIs do I get?
• How do I use them?
@croft#Devoxx #MicroProfile
What is MicroProfile?
• A collection of APIs
• Focused on, but not limited to, microservices
• A place for innovation
• A fast, time-boxed release cycle
• Community driven
@croft#Devoxx #MicroProfile
Why MicroProfile?
• Get involved in the future of Enterprise Java
• Java EE and the JCP are perceived as slow
• For your app
• The tech landscape is changing, microservice or not. MicroProfile
aims to provide tools to make the best use of new tech
@croft#Devoxx #MicroProfile
How do I get it?
• Choose your own adventure
• Payara Micro
• TomEE
• WildFly Swarm
• Open Liberty
• KumuluzEE
• Hammock
@croft#Devoxx #MicroProfile
What APIs do I get?
• MicroProfile 1.2
• Config 1.1
• Health Check 1.0
• Fault Tolerance 1.0
• JWT Propagation 1.0
• Metrics 1.0
@croft#Devoxx #MicroProfile
What APIs will I get?
• MicroProfile Future
• Open Tracing 1.0
• Open API 1.0
• TypeSafe Rest Client 1.0
• JSON-B 1.0
• Java EE 8 upgrades
• Maintenance Releases
UNCONFIRMED!
#Devoxx #MicroProfile @croft
Config 1.1
@croft#Devoxx #MicroProfile
Config 1.1
• Inject config values at runtime
• NOT a registry
• Values are read-only by design
• Specify your own config sources
• Ordinals for priority
• Higher number == higher priority
@croft#Devoxx #MicroProfile
Config 1.1
• Default Config Sources:
• META-INF/microprofile-config.properties (100)
• Environment variables (300)
• System Properties (400)
• Implementor (Payara) Default Config Sources:
• domain
• config
• server
• application
• module
• cluster
• jndi
@croft#Devoxx #MicroProfile
Config 1.1
• @ConfigProperty
• name
• defaultValue
@Inject
@ConfigProperty(name = "example.some.url")
private String someUrl;
@Inject
@ConfigProperty(name = "example.some.port")
private Optional<Integer> somePort;
@Inject
@ConfigProperty(name = "example.timeout",
defaultValue = "100")
private javax.inject.Provider<Long> timeout;
@croft#Devoxx #MicroProfile
Config 1.1
• Converters
• boolean/Boolean
• int and Integer
• long and Long
• float and Float
• double and Double
• Duration
• LocalTime, LocalDate, LocalDateTime
• OffsetDateTime, OffsetTime
• Instant
• URL
@croft#Devoxx #MicroProfile
Config 1.1
• Custom Config Sources:
• java.util.ServiceLoader
• For a single source
• ConfigSourceProvider
• For multiple sources
e.g. many properties files in JARs
public interface ConfigSource {
String CONFIG_ORDINAL = "config_ordinal";
Map<String, String> getProperties();
default Set<String> getPropertyNames() {
return getProperties().keySet();
}
default int getOrdinal() {
String configOrdinal =
getValue(CONFIG_ORDINAL);
if (configOrdinal != null) {
try {
return Integer.parseInt(configOrdinal);
} catch (NumberFormatException ignored) {
}
}
return 100;
}
String getValue(String propertyName);
String getName();
}
#Devoxx #MicroProfile @croft
Health Check 1.0
@croft#Devoxx #MicroProfile
Health Check 1.0
• @Health
• UP or DOWN
• Extra data can be optionally specified
@croft#Devoxx #MicroProfile
Health Check 1.0
• @Health
• Class annotation
• Must implement HealthCheck
• Must override call()
@Health
public class CheckDiskspace implements
HealthCheck {
@Override
public HealthCheckResponse call() {
return
HealthCheckResponse.named("diskspace")
.withData("free", "780mb")
.up()
.build();
}
}
#Devoxx #MicroProfile @croft
Metrics 1.0
@croft#Devoxx #MicroProfile
Metrics 1.0
• Annotations
• @Counted
• @Gauge
• @Metered
• @Timed
• @Metric
@croft#Devoxx #MicroProfile
Metrics 1.0
• @Counted
• monotonic
• Targets:
• Constructor
• Method
• Type
@Counted
public void serviceA() {
// only current
// invocations counted
}
@Counted(monotonic = true)
public void serviceB() {
// every invocation
// counted
}
@croft#Devoxx #MicroProfile
Metrics 1.0
• @Gauge
• unit
•Targets:
• Method
• Produces:
• Sampled value,
e.g. CPU temperature
@Gauge(unit = MetricUnits.MEGABYTES)
public long getHeapSize() {
return heapSize;
}
@Gauge(unit = MetricUnits.NONE)
public long getValue() {
return value;
}
@croft#Devoxx #MicroProfile
Metrics 1.0
• @Metered
• Targets:
• Constructor
• Method
• Type
• Produces:
• Mean throughput
• 1, 5, 15 minute moving avg
@Metered
public class MeteredBean {
public void serviceA() { ... }
public void serviceB() { ... }
}
@Metered
public void run(){
// do work
}
@croft#Devoxx #MicroProfile
Metrics 1.0
• @Timed
• Targets:
• Constructor
• Method
• Type
• Produces:
• Duration statistics
• Throughput statistics
@Timed
public class TimedBean {
public void serviceA() { ... }
public void serviceB() { ... }
}
@Timed
public void run(){
// do work
}
@croft#Devoxx #MicroProfile
Metrics 1.0
• @Metric
• Targets:
• Field
• Method
• Parameter
@Produces
@Metric(name = "hitPercent")
@ApplicationScoped
protected Gauge<Double> getHitPercent() {
return new Gauge<Double>() {
@Override
public Double getValue() {
return hits / total;
}
};
}
@Inject
public void init(
@Metric(name = "inst") Counter inst) {
inst.inc();
}
@croft#Devoxx #MicroProfile
Metrics 1.0
• Annotation Fields
• name
• absolute
• displayName
• description
• unit
• tags
@Counted(monotonic = true,
name = "Service B",
absolute = true,
displayName = "My Service B",
description = "Total invokes of B",
unit = MetricUnits.NONE,
tags = "key=value")
public void serviceB() {
}
@croft#Devoxx #MicroProfile
Metrics 1.0
• 3 Metrics registries
• base
• application
• vendor
• JSON format
• Prometheus text
format
{
"application": {
"hitCount": 45
},
"base": {
"thread.count": 33,
"thread.max.count": 47
},
"vendor": {
"someMetric": 100
}
}
@croft#Devoxx #MicroProfile
Metrics 1.0
• Sample prometheus.yml
• Found in the Vote service of the
Microprofile-Conference
application
• Liberty’s implementation is
secured by default, hence the need
for authentication
scrape_configs:
- job_name: 'microprofile-conference-vote'
tls_config:
insecure_skip_verify: true
basic_auth:
username: confAdmin
password: microprofile
scheme: https
static_configs:
- targets: ['localhost:9443']
#Devoxx #MicroProfile @croft
Fault Tolerance 1.0
@croft#Devoxx #MicroProfile
Fault Tolerance 1.0
• Implements common design patterns
• All annotations can be used together
• @Asynchronous
• @Retry
• @Fallback
• @CircuitBreaker
• @Bulkhead
• @Timeout
• See the spec for details
@croft#Devoxx #MicroProfile
Fault Tolerance 1.0
• @Asynchronous
• Annotate method or class
• Method(s) invoked in separate thread
• MUST return a Future
• Assumes requests should be synchronous if not specified
@croft#Devoxx #MicroProfile
Fault Tolerance 1.0
• @Retry
• delay (ms)
• delayUnit
• maxDuration (ms)
• durationUnit
• jitter (ms)
• jitterDelayUnit
• maxRetries
• retryOn
• abortOn
@Retry(delay = 400, maxDuration = 3200,
jitter = 400, maxRetries = 10)
public Connection serviceA() {
return connectionService();
}
@Retry(maxRetries = 90, maxDuration = 5,
durationUnit = ChronoUnit.SECONDS)
public void serviceB() {
writingService();
}
@Retry(retryOn = {IOException.class})
public void serviceC() {
readingService();
}
@croft#Devoxx #MicroProfile
Fault Tolerance 1.0
• @Fallback
• myFallback.class
• fallbackMethod
@Retry(maxRetries = 1)
@Fallback(StringFallbackHandler.class)
public String serviceZ() {
return "service A";
}
@Dependent
class StringFallbackHandler implements
FallbackHandler<String> {
@Override
public String handle(ExecutionContext
context){
return "Fallback for service A";
}
}
@Retry(maxRetries = 2)
@Fallback(fallbackMethod =
"fallbackForServiceB")
public String serviceB() {
return nameService();
}
private String fallbackForServiceB() {
return "myFallback";
}
@croft#Devoxx #MicroProfile
Fault Tolerance 1.0
• @CircuitBreaker
• successThreshold
• requestVolumeThreshold
• failureRatio
• delay
• Throws:
• CircuitBreakerOpenException
@CircuitBreaker(
successThreshold = 10,
requestVolumeThreshold = 4,
failureRatio=0.75,
delay = 1000)
public Connection serviceA() {
return connectionService();
}
@croft#Devoxx #MicroProfile
Fault Tolerance 1.0
•@Bulkhead
• Semaphore mode:
• value
• Threadpool mode:
• value
• waitingTaskQueue
• with @Asynchronous
• Throws:
• BulkheadException
In ThreadPool mode
@Bulkhead(5)
public Connection serviceA1() {
return connectionService();
}
@Asynchronous
@Bulkhead(value = 5,
waitingTaskQueue = 8)
public Future<Connection> serviceA2() {
return CompletableFuture.completedFuture(
connectionService());
}
@croft#Devoxx #MicroProfile
Fault Tolerance 1.0
• @Timeout
• Timeout in ms
• Can trigger @Fallback
• Can trigger @Retry
• Contributes to opening a Circuit
• Throws:
• TimeoutException
@Timeout(400)
public Connection serviceA() {
return connectionService();
}
#Devoxx #MicroProfile @croft
JWT Propagation 1.0
@croft#Devoxx #MicroProfile
JWT Propagation 1.0
• Token-based authentication
• Easily validated without second round-trip
• JSON format data
• Uses claims to carry auth information about a subject
• Processing trivial with JSON-P
• Agreed set of standard claims for interoperability
@croft#Devoxx #MicroProfile
JWT Propagation 1.0
• MicroProfile JWT Tokens can...
• Be used for authentication
• Be used for authorization
• Be mapped to JSR375 IdentityStore
• Support additional IANA standard claims
• Support additional non-standard claims
• 2 new standard claims
• upn: user principal
• groups: token subject’s group memberships
@croft#Devoxx #MicroProfile
JWT Propagation 1.0
• Min. Required Claims
• typ
• alg
• kid
• iss
• sub
• exp
• iat
• jti
• upn
• groups
{
"typ": "JWT",
"alg": "RS256",
"kid": "abc-1234567890"
}
{
"iss": "https://server.example.com",
"jti": "a-123",
"exp": 1311281970,
"iat": 1311280970,
"sub": "24400320",
"upn": "jdoe@server.example.com",
"groups": ["red-group", "green-group",
"admin-group", "admin"
]
}
@croft#Devoxx #MicroProfile
JWT Propagation 1.0
• @Claim
• Claims enum available for
standard claims
• Ambiguous uses throw
DeploymentException
• For complete details,
see the specification doc
@ApplicationScoped
public class MyEndpoint {
@Inject
@Claim(value = "exp",
standard = Claims.iat)
private Long timeClaim;
// Mixing exp with iat
// Throws exception
@Claim(standard = Claims.iss)
private Long timeClaim;
}
@croft#Devoxx #MicroProfile
Find Out More...
As a user...
• Choose your implementation!
• What specs does it support?
• Check the release notes…
• For the microprofile-bom
• For the individual specs
• Ask questions!
• In Gitter!
• In the Google Group!
@croft#Devoxx #MicroProfile
Find Out More...
As a contributor...
• What specifications are you interested in?
• An existing spec?
• Find the repository on GitHub (or on microprofile.io)
• Find the chat community on Gitter
• Find the hangout in the MicroProfile Calendar
• Something new?
• Start a discussion in the Google Group!
• Start coding in the Sandbox repository
• (PRs should be merged quickly)
Demo
@croft#Devoxx #MicroProfile
@croft#Devoxx #MicroProfile
Questions?
• How does MicroProfile relate to EE4J?
• How big is MicroProfile planning to get?
• There are no implementation rules - could be composable
• There will be some interdepency though - e.g. Config API widely
reused
• What about breaking changes?
• MicroProfile is about innovation primarily. Breaking changes will be
avoided where possible, but not if it limits progress.

More Related Content

What's hot

Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)mircodotta
 
Multithreading and concurrency in android
Multithreading and concurrency in androidMultithreading and concurrency in android
Multithreading and concurrency in androidRakesh Jha
 
Introduction of failsafe
Introduction of failsafeIntroduction of failsafe
Introduction of failsafeSunghyouk Bae
 
An introduction to the API for OnTime for IBM
An introduction to the API for OnTime for IBMAn introduction to the API for OnTime for IBM
An introduction to the API for OnTime for IBMontimesuite
 
Introduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users GroupIntroduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users GroupRoy Russo
 
Legacy Code Kata v3.0
Legacy Code Kata v3.0Legacy Code Kata v3.0
Legacy Code Kata v3.0William Munn
 
The Ring programming language version 1.5.2 book - Part 176 of 181
The Ring programming language version 1.5.2 book - Part 176 of 181The Ring programming language version 1.5.2 book - Part 176 of 181
The Ring programming language version 1.5.2 book - Part 176 of 181Mahmoud Samir Fayed
 
.NET Core, ASP.NET Core Course, Session 6
.NET Core, ASP.NET Core Course, Session 6.NET Core, ASP.NET Core Course, Session 6
.NET Core, ASP.NET Core Course, Session 6aminmesbahi
 
Javascript internals
Javascript internalsJavascript internals
Javascript internalsNir Noy
 
Programming Sideways: Asynchronous Techniques for Android
Programming Sideways: Asynchronous Techniques for AndroidProgramming Sideways: Asynchronous Techniques for Android
Programming Sideways: Asynchronous Techniques for AndroidEmanuele Di Saverio
 
Building Applications With the MEAN Stack
Building Applications With the MEAN StackBuilding Applications With the MEAN Stack
Building Applications With the MEAN StackNir Noy
 
Legacy Dependency Kata v2.0
Legacy Dependency Kata v2.0Legacy Dependency Kata v2.0
Legacy Dependency Kata v2.0William Munn
 
Bytecode manipulation with Javassist for fun and profit
Bytecode manipulation with Javassist for fun and profitBytecode manipulation with Javassist for fun and profit
Bytecode manipulation with Javassist for fun and profitJérôme Kehrli
 
The Ring programming language version 1.5.4 book - Part 180 of 185
The Ring programming language version 1.5.4 book - Part 180 of 185The Ring programming language version 1.5.4 book - Part 180 of 185
The Ring programming language version 1.5.4 book - Part 180 of 185Mahmoud Samir Fayed
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングscalaconfjp
 
Reactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-JavaReactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-JavaKasun Indrasiri
 
Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Andrei KUCHARAVY
 
.NET Core, ASP.NET Core Course, Session 2
.NET Core, ASP.NET Core Course, Session 2.NET Core, ASP.NET Core Course, Session 2
.NET Core, ASP.NET Core Course, Session 2aminmesbahi
 

What's hot (20)

Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
 
Multithreading and concurrency in android
Multithreading and concurrency in androidMultithreading and concurrency in android
Multithreading and concurrency in android
 
Introduction of failsafe
Introduction of failsafeIntroduction of failsafe
Introduction of failsafe
 
An introduction to the API for OnTime for IBM
An introduction to the API for OnTime for IBMAn introduction to the API for OnTime for IBM
An introduction to the API for OnTime for IBM
 
Efficient Android Threading
Efficient Android ThreadingEfficient Android Threading
Efficient Android Threading
 
Introduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users GroupIntroduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users Group
 
Legacy Code Kata v3.0
Legacy Code Kata v3.0Legacy Code Kata v3.0
Legacy Code Kata v3.0
 
The Ring programming language version 1.5.2 book - Part 176 of 181
The Ring programming language version 1.5.2 book - Part 176 of 181The Ring programming language version 1.5.2 book - Part 176 of 181
The Ring programming language version 1.5.2 book - Part 176 of 181
 
.NET Core, ASP.NET Core Course, Session 6
.NET Core, ASP.NET Core Course, Session 6.NET Core, ASP.NET Core Course, Session 6
.NET Core, ASP.NET Core Course, Session 6
 
Javascript internals
Javascript internalsJavascript internals
Javascript internals
 
Programming Sideways: Asynchronous Techniques for Android
Programming Sideways: Asynchronous Techniques for AndroidProgramming Sideways: Asynchronous Techniques for Android
Programming Sideways: Asynchronous Techniques for Android
 
Building Applications With the MEAN Stack
Building Applications With the MEAN StackBuilding Applications With the MEAN Stack
Building Applications With the MEAN Stack
 
Legacy Dependency Kata v2.0
Legacy Dependency Kata v2.0Legacy Dependency Kata v2.0
Legacy Dependency Kata v2.0
 
Bytecode manipulation with Javassist for fun and profit
Bytecode manipulation with Javassist for fun and profitBytecode manipulation with Javassist for fun and profit
Bytecode manipulation with Javassist for fun and profit
 
The Ring programming language version 1.5.4 book - Part 180 of 185
The Ring programming language version 1.5.4 book - Part 180 of 185The Ring programming language version 1.5.4 book - Part 180 of 185
The Ring programming language version 1.5.4 book - Part 180 of 185
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
 
Reactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-JavaReactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-Java
 
Android concurrency
Android concurrencyAndroid concurrency
Android concurrency
 
Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1
 
.NET Core, ASP.NET Core Course, Session 2
.NET Core, ASP.NET Core Course, Session 2.NET Core, ASP.NET Core Course, Session 2
.NET Core, ASP.NET Core Course, Session 2
 

Similar to MicroProfile: A Quest for a Lightweight and Modern Enterprise Java Platform

IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & MobileIVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & MobileAmazon Web Services Japan
 
Lightweight Enterprise Java With Microprofile
Lightweight Enterprise Java With MicroprofileLightweight Enterprise Java With Microprofile
Lightweight Enterprise Java With MicroprofileRoberto Cortez
 
Spring Framework Introduction
Spring Framework IntroductionSpring Framework Introduction
Spring Framework IntroductionAlex Su
 
O365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio StruyfO365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio StruyfNCCOMMS
 
Enhance existing REST APIs (e.g. Facebook Graph API) with code completion us...
Enhance existing REST APIs  (e.g. Facebook Graph API) with code completion us...Enhance existing REST APIs  (e.g. Facebook Graph API) with code completion us...
Enhance existing REST APIs (e.g. Facebook Graph API) with code completion us...johannes_fiala
 
The Meteor Framework
The Meteor FrameworkThe Meteor Framework
The Meteor FrameworkDamien Magoni
 
Android with dagger_2
Android with dagger_2Android with dagger_2
Android with dagger_2Kros Huang
 
Architecting for Microservices Part 2
Architecting for Microservices Part 2Architecting for Microservices Part 2
Architecting for Microservices Part 2Elana Krasner
 
2015 JavaOne Java EE Connectors - The Secret Weapon Reloaded
2015 JavaOne Java EE Connectors - The Secret Weapon Reloaded2015 JavaOne Java EE Connectors - The Secret Weapon Reloaded
2015 JavaOne Java EE Connectors - The Secret Weapon ReloadedJonathan Gallimore
 
Java EE changes design pattern implementation: JavaDays Kiev 2015
Java EE changes design pattern implementation: JavaDays Kiev 2015Java EE changes design pattern implementation: JavaDays Kiev 2015
Java EE changes design pattern implementation: JavaDays Kiev 2015Alex Theedom
 
gRPC on .NET Core - NDC Oslo 2020
gRPC on .NET Core - NDC Oslo 2020gRPC on .NET Core - NDC Oslo 2020
gRPC on .NET Core - NDC Oslo 2020James Newton-King
 
Angular Application Testing
Angular Application TestingAngular Application Testing
Angular Application TestingTroy Miles
 
Drupal, Android and iPhone
Drupal, Android and iPhoneDrupal, Android and iPhone
Drupal, Android and iPhoneAlexandru Badiu
 
U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...
U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...
U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...Michael Rys
 
Field injection, type safe configuration, and more new goodies in Declarative...
Field injection, type safe configuration, and more new goodies in Declarative...Field injection, type safe configuration, and more new goodies in Declarative...
Field injection, type safe configuration, and more new goodies in Declarative...bjhargrave
 
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014FalafelSoftware
 
Breaking Dependencies to Allow Unit Testing
Breaking Dependencies to Allow Unit TestingBreaking Dependencies to Allow Unit Testing
Breaking Dependencies to Allow Unit TestingSteven Smith
 

Similar to MicroProfile: A Quest for a Lightweight and Modern Enterprise Java Platform (20)

IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & MobileIVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
 
Lightweight Enterprise Java With Microprofile
Lightweight Enterprise Java With MicroprofileLightweight Enterprise Java With Microprofile
Lightweight Enterprise Java With Microprofile
 
Spring Framework Introduction
Spring Framework IntroductionSpring Framework Introduction
Spring Framework Introduction
 
O365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio StruyfO365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
 
Windows 8 Apps and the Outside World
Windows 8 Apps and the Outside WorldWindows 8 Apps and the Outside World
Windows 8 Apps and the Outside World
 
Enhance existing REST APIs (e.g. Facebook Graph API) with code completion us...
Enhance existing REST APIs  (e.g. Facebook Graph API) with code completion us...Enhance existing REST APIs  (e.g. Facebook Graph API) with code completion us...
Enhance existing REST APIs (e.g. Facebook Graph API) with code completion us...
 
The Meteor Framework
The Meteor FrameworkThe Meteor Framework
The Meteor Framework
 
Android with dagger_2
Android with dagger_2Android with dagger_2
Android with dagger_2
 
Architecting for Microservices Part 2
Architecting for Microservices Part 2Architecting for Microservices Part 2
Architecting for Microservices Part 2
 
2015 JavaOne Java EE Connectors - The Secret Weapon Reloaded
2015 JavaOne Java EE Connectors - The Secret Weapon Reloaded2015 JavaOne Java EE Connectors - The Secret Weapon Reloaded
2015 JavaOne Java EE Connectors - The Secret Weapon Reloaded
 
Java EE changes design pattern implementation: JavaDays Kiev 2015
Java EE changes design pattern implementation: JavaDays Kiev 2015Java EE changes design pattern implementation: JavaDays Kiev 2015
Java EE changes design pattern implementation: JavaDays Kiev 2015
 
gRPC on .NET Core - NDC Oslo 2020
gRPC on .NET Core - NDC Oslo 2020gRPC on .NET Core - NDC Oslo 2020
gRPC on .NET Core - NDC Oslo 2020
 
Angular Application Testing
Angular Application TestingAngular Application Testing
Angular Application Testing
 
Angular2 inter3
Angular2 inter3Angular2 inter3
Angular2 inter3
 
Drupal, Android and iPhone
Drupal, Android and iPhoneDrupal, Android and iPhone
Drupal, Android and iPhone
 
U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...
U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...
U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...
 
Life outside WO
Life outside WOLife outside WO
Life outside WO
 
Field injection, type safe configuration, and more new goodies in Declarative...
Field injection, type safe configuration, and more new goodies in Declarative...Field injection, type safe configuration, and more new goodies in Declarative...
Field injection, type safe configuration, and more new goodies in Declarative...
 
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014
 
Breaking Dependencies to Allow Unit Testing
Breaking Dependencies to Allow Unit TestingBreaking Dependencies to Allow Unit Testing
Breaking Dependencies to Allow Unit Testing
 

Recently uploaded

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 

Recently uploaded (20)

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 

MicroProfile: A Quest for a Lightweight and Modern Enterprise Java Platform

  • 1. @croft#Devoxx #MicroProfile Eclipse MicroProfile: A Quest for a Lightweight and Modern Enterprise Java Platform Mike Croft Payara
  • 2. @croft#Devoxx #MicroProfile The Quest • What is MicroProfile? • Why MicroProfile? • How do I get it? • What APIs do I get? • How do I use them?
  • 3. @croft#Devoxx #MicroProfile What is MicroProfile? • A collection of APIs • Focused on, but not limited to, microservices • A place for innovation • A fast, time-boxed release cycle • Community driven
  • 4. @croft#Devoxx #MicroProfile Why MicroProfile? • Get involved in the future of Enterprise Java • Java EE and the JCP are perceived as slow • For your app • The tech landscape is changing, microservice or not. MicroProfile aims to provide tools to make the best use of new tech
  • 5. @croft#Devoxx #MicroProfile How do I get it? • Choose your own adventure • Payara Micro • TomEE • WildFly Swarm • Open Liberty • KumuluzEE • Hammock
  • 6. @croft#Devoxx #MicroProfile What APIs do I get? • MicroProfile 1.2 • Config 1.1 • Health Check 1.0 • Fault Tolerance 1.0 • JWT Propagation 1.0 • Metrics 1.0
  • 7. @croft#Devoxx #MicroProfile What APIs will I get? • MicroProfile Future • Open Tracing 1.0 • Open API 1.0 • TypeSafe Rest Client 1.0 • JSON-B 1.0 • Java EE 8 upgrades • Maintenance Releases UNCONFIRMED!
  • 9. @croft#Devoxx #MicroProfile Config 1.1 • Inject config values at runtime • NOT a registry • Values are read-only by design • Specify your own config sources • Ordinals for priority • Higher number == higher priority
  • 10. @croft#Devoxx #MicroProfile Config 1.1 • Default Config Sources: • META-INF/microprofile-config.properties (100) • Environment variables (300) • System Properties (400) • Implementor (Payara) Default Config Sources: • domain • config • server • application • module • cluster • jndi
  • 11. @croft#Devoxx #MicroProfile Config 1.1 • @ConfigProperty • name • defaultValue @Inject @ConfigProperty(name = "example.some.url") private String someUrl; @Inject @ConfigProperty(name = "example.some.port") private Optional<Integer> somePort; @Inject @ConfigProperty(name = "example.timeout", defaultValue = "100") private javax.inject.Provider<Long> timeout;
  • 12. @croft#Devoxx #MicroProfile Config 1.1 • Converters • boolean/Boolean • int and Integer • long and Long • float and Float • double and Double • Duration • LocalTime, LocalDate, LocalDateTime • OffsetDateTime, OffsetTime • Instant • URL
  • 13. @croft#Devoxx #MicroProfile Config 1.1 • Custom Config Sources: • java.util.ServiceLoader • For a single source • ConfigSourceProvider • For multiple sources e.g. many properties files in JARs public interface ConfigSource { String CONFIG_ORDINAL = "config_ordinal"; Map<String, String> getProperties(); default Set<String> getPropertyNames() { return getProperties().keySet(); } default int getOrdinal() { String configOrdinal = getValue(CONFIG_ORDINAL); if (configOrdinal != null) { try { return Integer.parseInt(configOrdinal); } catch (NumberFormatException ignored) { } } return 100; } String getValue(String propertyName); String getName(); }
  • 15. @croft#Devoxx #MicroProfile Health Check 1.0 • @Health • UP or DOWN • Extra data can be optionally specified
  • 16. @croft#Devoxx #MicroProfile Health Check 1.0 • @Health • Class annotation • Must implement HealthCheck • Must override call() @Health public class CheckDiskspace implements HealthCheck { @Override public HealthCheckResponse call() { return HealthCheckResponse.named("diskspace") .withData("free", "780mb") .up() .build(); } }
  • 18. @croft#Devoxx #MicroProfile Metrics 1.0 • Annotations • @Counted • @Gauge • @Metered • @Timed • @Metric
  • 19. @croft#Devoxx #MicroProfile Metrics 1.0 • @Counted • monotonic • Targets: • Constructor • Method • Type @Counted public void serviceA() { // only current // invocations counted } @Counted(monotonic = true) public void serviceB() { // every invocation // counted }
  • 20. @croft#Devoxx #MicroProfile Metrics 1.0 • @Gauge • unit •Targets: • Method • Produces: • Sampled value, e.g. CPU temperature @Gauge(unit = MetricUnits.MEGABYTES) public long getHeapSize() { return heapSize; } @Gauge(unit = MetricUnits.NONE) public long getValue() { return value; }
  • 21. @croft#Devoxx #MicroProfile Metrics 1.0 • @Metered • Targets: • Constructor • Method • Type • Produces: • Mean throughput • 1, 5, 15 minute moving avg @Metered public class MeteredBean { public void serviceA() { ... } public void serviceB() { ... } } @Metered public void run(){ // do work }
  • 22. @croft#Devoxx #MicroProfile Metrics 1.0 • @Timed • Targets: • Constructor • Method • Type • Produces: • Duration statistics • Throughput statistics @Timed public class TimedBean { public void serviceA() { ... } public void serviceB() { ... } } @Timed public void run(){ // do work }
  • 23. @croft#Devoxx #MicroProfile Metrics 1.0 • @Metric • Targets: • Field • Method • Parameter @Produces @Metric(name = "hitPercent") @ApplicationScoped protected Gauge<Double> getHitPercent() { return new Gauge<Double>() { @Override public Double getValue() { return hits / total; } }; } @Inject public void init( @Metric(name = "inst") Counter inst) { inst.inc(); }
  • 24. @croft#Devoxx #MicroProfile Metrics 1.0 • Annotation Fields • name • absolute • displayName • description • unit • tags @Counted(monotonic = true, name = "Service B", absolute = true, displayName = "My Service B", description = "Total invokes of B", unit = MetricUnits.NONE, tags = "key=value") public void serviceB() { }
  • 25. @croft#Devoxx #MicroProfile Metrics 1.0 • 3 Metrics registries • base • application • vendor • JSON format • Prometheus text format { "application": { "hitCount": 45 }, "base": { "thread.count": 33, "thread.max.count": 47 }, "vendor": { "someMetric": 100 } }
  • 26. @croft#Devoxx #MicroProfile Metrics 1.0 • Sample prometheus.yml • Found in the Vote service of the Microprofile-Conference application • Liberty’s implementation is secured by default, hence the need for authentication scrape_configs: - job_name: 'microprofile-conference-vote' tls_config: insecure_skip_verify: true basic_auth: username: confAdmin password: microprofile scheme: https static_configs: - targets: ['localhost:9443']
  • 28. @croft#Devoxx #MicroProfile Fault Tolerance 1.0 • Implements common design patterns • All annotations can be used together • @Asynchronous • @Retry • @Fallback • @CircuitBreaker • @Bulkhead • @Timeout • See the spec for details
  • 29. @croft#Devoxx #MicroProfile Fault Tolerance 1.0 • @Asynchronous • Annotate method or class • Method(s) invoked in separate thread • MUST return a Future • Assumes requests should be synchronous if not specified
  • 30. @croft#Devoxx #MicroProfile Fault Tolerance 1.0 • @Retry • delay (ms) • delayUnit • maxDuration (ms) • durationUnit • jitter (ms) • jitterDelayUnit • maxRetries • retryOn • abortOn @Retry(delay = 400, maxDuration = 3200, jitter = 400, maxRetries = 10) public Connection serviceA() { return connectionService(); } @Retry(maxRetries = 90, maxDuration = 5, durationUnit = ChronoUnit.SECONDS) public void serviceB() { writingService(); } @Retry(retryOn = {IOException.class}) public void serviceC() { readingService(); }
  • 31. @croft#Devoxx #MicroProfile Fault Tolerance 1.0 • @Fallback • myFallback.class • fallbackMethod @Retry(maxRetries = 1) @Fallback(StringFallbackHandler.class) public String serviceZ() { return "service A"; } @Dependent class StringFallbackHandler implements FallbackHandler<String> { @Override public String handle(ExecutionContext context){ return "Fallback for service A"; } } @Retry(maxRetries = 2) @Fallback(fallbackMethod = "fallbackForServiceB") public String serviceB() { return nameService(); } private String fallbackForServiceB() { return "myFallback"; }
  • 32. @croft#Devoxx #MicroProfile Fault Tolerance 1.0 • @CircuitBreaker • successThreshold • requestVolumeThreshold • failureRatio • delay • Throws: • CircuitBreakerOpenException @CircuitBreaker( successThreshold = 10, requestVolumeThreshold = 4, failureRatio=0.75, delay = 1000) public Connection serviceA() { return connectionService(); }
  • 33. @croft#Devoxx #MicroProfile Fault Tolerance 1.0 •@Bulkhead • Semaphore mode: • value • Threadpool mode: • value • waitingTaskQueue • with @Asynchronous • Throws: • BulkheadException In ThreadPool mode @Bulkhead(5) public Connection serviceA1() { return connectionService(); } @Asynchronous @Bulkhead(value = 5, waitingTaskQueue = 8) public Future<Connection> serviceA2() { return CompletableFuture.completedFuture( connectionService()); }
  • 34. @croft#Devoxx #MicroProfile Fault Tolerance 1.0 • @Timeout • Timeout in ms • Can trigger @Fallback • Can trigger @Retry • Contributes to opening a Circuit • Throws: • TimeoutException @Timeout(400) public Connection serviceA() { return connectionService(); }
  • 36. @croft#Devoxx #MicroProfile JWT Propagation 1.0 • Token-based authentication • Easily validated without second round-trip • JSON format data • Uses claims to carry auth information about a subject • Processing trivial with JSON-P • Agreed set of standard claims for interoperability
  • 37. @croft#Devoxx #MicroProfile JWT Propagation 1.0 • MicroProfile JWT Tokens can... • Be used for authentication • Be used for authorization • Be mapped to JSR375 IdentityStore • Support additional IANA standard claims • Support additional non-standard claims • 2 new standard claims • upn: user principal • groups: token subject’s group memberships
  • 38. @croft#Devoxx #MicroProfile JWT Propagation 1.0 • Min. Required Claims • typ • alg • kid • iss • sub • exp • iat • jti • upn • groups { "typ": "JWT", "alg": "RS256", "kid": "abc-1234567890" } { "iss": "https://server.example.com", "jti": "a-123", "exp": 1311281970, "iat": 1311280970, "sub": "24400320", "upn": "jdoe@server.example.com", "groups": ["red-group", "green-group", "admin-group", "admin" ] }
  • 39. @croft#Devoxx #MicroProfile JWT Propagation 1.0 • @Claim • Claims enum available for standard claims • Ambiguous uses throw DeploymentException • For complete details, see the specification doc @ApplicationScoped public class MyEndpoint { @Inject @Claim(value = "exp", standard = Claims.iat) private Long timeClaim; // Mixing exp with iat // Throws exception @Claim(standard = Claims.iss) private Long timeClaim; }
  • 40. @croft#Devoxx #MicroProfile Find Out More... As a user... • Choose your implementation! • What specs does it support? • Check the release notes… • For the microprofile-bom • For the individual specs • Ask questions! • In Gitter! • In the Google Group!
  • 41. @croft#Devoxx #MicroProfile Find Out More... As a contributor... • What specifications are you interested in? • An existing spec? • Find the repository on GitHub (or on microprofile.io) • Find the chat community on Gitter • Find the hangout in the MicroProfile Calendar • Something new? • Start a discussion in the Google Group! • Start coding in the Sandbox repository • (PRs should be merged quickly)
  • 43. @croft#Devoxx #MicroProfile Questions? • How does MicroProfile relate to EE4J? • How big is MicroProfile planning to get? • There are no implementation rules - could be composable • There will be some interdepency though - e.g. Config API widely reused • What about breaking changes? • MicroProfile is about innovation primarily. Breaking changes will be avoided where possible, but not if it limits progress.