SlideShare a Scribd company logo
Emily Jiang, Java Champion
IBM, STSM, Cloud Native Architect and Advocate
X/LinkedIn: @emilyfhjiang
14th June 2024
Master a Cloud Native
Application Standard:
MicroProfile
Agenda
01
02
03
2
MicroProfile Background
MicroProfile Deep Dive
MicroProfile Future
Community
Driven
Lightweight,
Iterative Processes
Specs, APIs, TCKs
Implementations
WebSphere
Liberty
Working Group members
MicroProfile 1.0
(Fall 2016)
MicroProfile 1.1
(Aug. 2017)
MicroProfile 1.2
(Sept 2017)
2017
2018
MicroProfile 1.3
(Dec 2017)
MicroProfile 1.4
(June 2018)
2019
MicroProfile 2.0.1
(July 2018)
MicroProfile 2.1
(Oct 2018)
MicroProfile 2.2
(Feb 2019)
MicroProfile 3.0
(June 2019)
MicroProfile 3.2
(Nov 2019)
2020
MicroProfile 3.3
(Feb 2020)
MicroProfile 4.0
(Oct. 2020)
MicroProfile 4.1
(July. 2021)
MicroProfile 5.0
(Dec. 2021)
Config 3.0
Metrics 4.0
Fault Tolerance 4.0
Health 4.0
Rest Client 3.0
OpenAPI 3.0
OpenTracing 3.0
JWT Auth 2.0
Jakarta CDI 3.0 //Jakarta EE 9.1
Jakarta RESTful Web Services //Jakarta EE 9.1
Jakarta JSON-P //Jakarta EE 9.1
Jakarta JSON-B 2.0 //Jakarta EE 9.1
Jakarta Annotations 2.0 //Jakarta EE 9.1
2022
2021
MicroProfile 6.0
(Dec. 2022)
Config 3.0
Metrics 5.0
Fault Tolerance 4.0
Health 4.0
Rest Client 3.0
OpenAPI 3.1
Telemetry 1.0
JWT Auth 2.1
Jakarta EE 10 Core Profile
MicroProfile 6.1
(Oct. 2023)
Config 3.1
Metrics 5.1
Fault Tolerance 4.0
Health 4.0
Rest Client 3.0
OpenAPI 3.1
Telemetry 1.1
JWT Auth 2.1
Jakarta EE 10 Core
Profile
2023
2024
MicroProfile 7.0
(2024)
Config 3.1
Fault Tolerance 4.1
Health 4.0
Rest Client 4.0
OpenAPI 4.0
Telemetry 2.0
JWT Auth 2.1
MicroProfile
Health Metrics
Fault
Tolerance
Open API Config
Telemetry
JWT
Rest Client
GraphQL
Reactive
Streams
Operators
Reactive
Messaging
Context
Propagation
Platform Release
Standalone Release
Jakarta EE
Core Profile
LRA
Open Tracing
MicroProfile 6.1 in Oct. 2023
Health 4.0 Metrics 5.1
Fault
Tolerance 4.0
Open API 3.1 Config 3.1
Telemetry 1.1
JWT 2.1
Rest Client
3.0
Jakarta EE 10
Core Profile
Updated specs Unchanged specs Jakarta EE 10 Core Profile specs
Core
Integrate
Observe
MicroProfile 7.0 in 2024
Health 4.0
Fault
Tolerance 4.1
Open API 4.0 Config 3.1
Telemetry 2.0
JWT 2.1
Rest Client
4.0
Jakarta EE 10
Core Profile
Updated specs Unchanged specs Jakarta EE 10 Core Profile specs
Core
Integrate
Observe
– The release date is subject to change.
Agenda
01
02
03
10
IBM TechXchange / © 2023 IBM Corporation
MicroProfile background
MicroProfile Deep Dive
MicroProfile future
11
Use case: As a developer, I need
to create a microservice working
in a cloud.
Jakarta REST
B
@ApplicationPath("System")
public class SystemApplication extends
Application {}
@Path("properties")
public class PropertiesResource {
@GET
@Produces(MediaType.APPLICATION_JSON)
public JsonObject getProperties() {…}
}
13
I need to configure my services in
my deployment environment
A
MicroProfile Config
B
@Inject
@ConfigProperty(name = "inMaintenance")
private Provider<Boolean> inMaintenance;
config_ordinal=100
inMaintenance=false
{
"config_ordinal":150,
"inMaintenance":true
}
https://github.com/eclipse/microprofile-config/
15
I want to call other microservices
MicroProfile REST Client
B
A
@Inject
@RestClient
private SystemClient defaultRestClient;
@Dependent
@RegisterRestClient
@RegisterProvider(UnknownUrlExceptionMapper.class)
@Path("/properties")
public interface SystemClient {
@GET
@Produces(MediaType.APPLICATION_JSON)
public Properties getProperties() throws
UnknownUrlException, ProcessingException;
}
io.openliberty.guides.inventory.client.SystemClient/mp-rest/url=http://localhost:9080/system
https://github.com/eclipse/microprofile-rest-client
17
What does the service do?
MicroProfile OpenAPI
A B
openapi: 3.0.0
info:
title: Inventory App
description: App for storing JVM system properties of various
hosts.
license:
name: Eclipse Public License - v 1.0
url: https://www.eclipse.org/legal/epl-v10.html
version: "1.0"
servers: - url: http://localhost:{port} description: Simple Open
Liberty.
variables:
port:
description: Server HTTP port.
default: "9080"
paths:
/inventory/systems:
get:
summary: List inventory contents.
description: Returns the currently stored host:properties
pairs in the inventory.
operationId: listContents
responses:
200:
description: host:properties pairs stored in the inventory.
content:
application/json:
schema:
$ref: '#/components/schemas/InventoryList’
….
http://localhost:9080/openapi/ui
https://github.com/eclipse/microprofile-open-api/
19
I need to provide a good
response to my clients no matter
what happens.
MicroProfile Fault Tolerance
A B
@Fallback(fallbackMethod = "fallbackForGet")
public Properties get(String hostname) throws IOException
{
return invUtils.getProperties(hostname);
}
https://github.com/eclipse/microprofile-fault-tolerance/
MicroProfile Fault Tolerance
– The annotations can be used together.
– When MicroProfile Metrics is enabled, their usages are monitored.
– The values can be configured via MicroProfile Config.
@Retry @Timeout @CircuitBreaker
@Bulkhead @Asynchronous @Fallback
22
I need to protect my services to
prevent from unauthorized
access
MicroProfile JWT
A B
@GET
@RolesAllowed({ "admin", "user" })
@Path("{hostname}")
@Produces(MediaType.APPLICATION_JSON)
public Response getPropertiesForHost(@PathParam("hostname") String hostname,
@Context HttpHeaders httpHeaders) {…}
https://github.com/eclipse/microprofile-jwt-auth/
24
I need to ensure they work in the
Cloud and observe them.
MicroProfile
Health Metrics
Fault
Tolerance
Open API Config
Telemetry
JWT
Rest Client
Jakarta EE
Core Profile
26
I need my service to
communicate with Kubernetes
so that requests can be routed
when my service is ready.
MicroProfile Health
A B
@Readiness
@ApplicationScoped
public class InventoryResource implements HealthCheck {
...
public boolean isHealthy() {...}
@Override
public HealthCheckResponse call() {
if (!isHealthy()) {
return
HealthCheckResponse.named(“ServiceHealthCheck”).withData(…).down().build();
}
return
HealthCheckResponse.named(“ServiceHealthCheck”).withData(…).up().build();
}
}
https://github.com/eclipse/microprofile-health/
MicroProfile Health 3.1
Startup Probe
Liveness Probe
Readiness Probe
mpHealth-3.1 feature Application provided health
checks
/health
/health/ready
/health/live
Health Check D
@Readiness
Health Check E
@Readiness
Health Check C
@Liveness
/health/started
Health Check A
@Startup
Health Check B
@Startup
Application 1
HTTP GET
In Kubernetes, when the startup probe is
configured, the liveness and readiness checks
are disabled, until it succeeds.
Kubernetes
29
I need to know how my service is
performing.
MicroProfile Metrics
A B
@Timed(name = "inventoryPropertiesRequestTime”,
description = "Time needed to get the properties of" +
"a system from the given hostname")
public Properties get(String hostname) {
return invUtils.getProperties(hostname);
}
https://github.com/eclipse/microprofile-metrics/
MicroProfile Metrics 5.1
Influenced by Micrometer
All metrics are under /metrics endpoint.
Data is returned from /metrics calls in the Prometheus 0.0.4 exposition format.
Implementation can use Micrometer or OpenTelemetry Metrics
MicroProfile Metrics 5.1
Liberty mpMetrics-5.1
• Tracks metrics from Liberty components and the JVM to help you understand how your servers are performing.
• Provides the MicroProfile Metrics API, which you can use to add metrics to your applications.
• Provides the ability to group application metrics into custom scopes and allows querying of metrics by those scopes.
• Is based on Micrometer - can ship metrics to your choice of monitoring systems (currently including AppOptics, Azure Monitor, Netflix Atlas,
CloudWatch, Datadog, Dynatrace, Elastic, Ganglia, Graphite, Humio, Influx/Telegraf, JMX, KairosDB, New Relic, Prometheus, SignalFx,
Google Stackdriver, StatsD, and Wavefront.)
Micrometer and Prometheus meter registry included in
mpMetrics-5.0.
Provide other meter registries if you want to connect to a different
monitoring system.
33
I need to identify the root cause
if something goes wrong.
MicroProfile Telemetry
A B
@WithSpan(name=“list”)
public InventoryList list() {
return new InventoryList(systems);
}
Jakarta REST methods are
automatically traced by default
https://github.com/eclipse/microprofile-telemetry/
MicroProfile Telemetry
35
• Adopts OpenTelemetry Tracing
• Set of APIs, SDKs, tooling and integrations
• Designed for the creation and management of
telemetry data (traces, metrics, and logs)
• Supports 3 instrumentations:
• Manual
• Automatic
• Java Agent
MicroProfile Telemetry
• Support Java agent instrumentation
-javaagent:opentelemetry-javaagent.jar
-Dotel.service.name=<name>
-Dotel.traces.exporter=jaeger
-Dotel.instrumentation.opentelemetry-api.enabled=false
• Automatically tracing of REST (server and client) calls, and MicroProfile REST Client calls
without code modification.
• Manual instrumentation using OpenTelemetry API
–@WithSpan
–@SpanAttribute
–@Inject io.opentelemetry.api.OpenTelemetry
–@Inject io.opentelemetry.api.trace.Tracer
–@Inject io.opentelemetry.api.trace.Span
–@Inject io.opentelemetry.api.baggage.Baggage
java -javaagent:path/to/opentelemetry-javaagent.jar 
-Dotel.service.name=your-service-name 
-Dotel.traces.exporter=zipkin 
-jar myapp.jar
How MP Telemetry works
– https://openliberty.io/guides/microprofile-telemetry-jaeger.html
38
Done the development. Time to
deploy to my chosen Cloud. How
to do it?
Cloud-Native Application Deployment
Kubernetes Istio
Docker
or
Podman
Health Metrics
Fault
Tolerance
Open API Config
Open Tracing
JWT
Rest Client
Jakarta EE
Core Profile
MicroProfile Config with Kubernetes
A B
env:
- name: GREETING
valueFrom:
configMapKeyRef:
name: greeting-config
key: message
kubectl create configmap greeting-config --from-literal message=Hello...
@Inject
@ConfigProperty(name = "GREETING")
private String greeting;
MicroProfile Health with Kubernetes
A B
readinessProbe:
httpGet:
path: /health/ready
port: 9080
initialDelaySeconds: 15
periodSeconds: 5
failureThreshold: 1
MicroProfile Metrics with Kubernetes
A B
@POST
@Counted(name="order", displayName="Order count",
description="Number of times orders requested.")
public Response orderCoffee(@Valid @NotNull CoffeeOrder order) {
...
}
Data in OpenMetrics
format
Collect and store data
with Prometheus
Visualize data with
Grafana
MicroProfile Telemetry
7 HTTP headers required by Istio propagated
All Jakarta REST
requests traced
Istio & MicroProfile - Putting it all together
45
I need to create a reactive
microservice.
MicroProfile Reactive Messaging
MicroProfile Reactive Messaging relies on MicroProfile Reactive Operators
MicroProfile Reactive Messaging
The MicroProfile Reactive Messaging API provides a simple way to configure the streams and event queues
using annotations
– https://openliberty.io/guides/microprofile-reactive-messaging.html
MicroProfile Reactive Messaging 3.0
Imperative code bridges with reactive code
49
How to do transactions in
microservices? SAGA pattern?
MicroProfile LRA
• Cloud Native Transaction model based on compensating Saga model
• Loosely coupled µServices with eventually consistent data
LRA Coordinator
µS A µS B µS C
• Orchestration via a Coordinator Service that Participant
µServices registers with
• Annotations for joining, completing and compensating
transactions
MicroProfile LRA
Need to maintain data consistency across multiple µservices
where each has their own data.
The multiple operations form the atomic action which needs to be
processed together
In the case of failures compensation actions are invoked
Flight
µS
Book
Taxi µS
Hotel
µS
Book Book
Flight
µS
Taxi µS
Hotel
µS
Confirm Confirm
Confirm
Start LRA
End LRA
Successful
Flight
µS
Book
Taxi µS
Hotel
µS
Book Book
Flight
µS
Book
Taxi µS
Hotel
µS
Book Book
Flight
µS
Taxi µS
Failed
Compensate
Compensate
Start LRA
End LRA
❌
Error
In the case of success, complete actions are invoked
52
I need to frequently
query/update data. What should
I do?
MicroProfile GraphQL
• Avoiding over-fetching or under-fetching
data.
• Enabling data models to evolve, schema
driven.
• Provide a "code-first" set of APIs that will
enable users to quickly develop portable
GraphQL-based applications in Java
– GraphQL Entities
Scalars, or simple type
Enumerable types (similar to Java Enum)
Complex objects : scalars and/or enums and/or other complex objects and/or collections of these.
– GraphQL Components
– @GraphQLApi : GraphQL endpoints must be annotated with the @GraphQLApi annotation.
– @Query: allows a user to ask for all or specific fields on an object or collection of objects.
– @Mutation: create new entities or update or delete existing entities.
– https://openliberty.io/guides/microprofile-graphql.html
54
I am convinced to use
MicroProfile. Where to start?
How to get started?
https://start.microprofile.io/
Open Liberty Starter
https://start.openliberty.io
57
Are there any learning
materials?
Learning materials
– https://openliberty.io/guides/?search=microprofile
– https://github.com/Emily-Jiang/jcon
– https://microprofile.io/
59
MicroProfile Book featured Open Liberty
https://ibm.biz/MicroProfileBook
Twitter/LinkedIn: @emilyfhjiang
Agenda
01
02
03
60
IBM TechXchange / © 2023 IBM Corporation
MicroProfile background
MicroProfile Deep Dive
MicroProfile future
MicroProfile in 2024
● MicroProfile 7.0 in 3Q 2024
○ Adopt OpenTelemetry Metrics in MicroProfile Telemetry 2.0
○ Move MicroProfile Metrics to be a standalone spec
○ Make Jakarta EE Core Profile dependency loosely coupled
○ The updated specifications: Telemetry 2.0, Fault Tolerance 4.1, OpenAPI 4.0, Rest
Client 4.0
● New specifications
○ Evaluate a new specification: AI with the focus on LLM
■ If interested, join the weekly Monday AI group discussions
61
62
Q&A
Emily Jiang
IBM, Cloud Native Architect & Advocate
emijiang@uk.ibm.com
X/LinkedIn: @emilyfhjiang
Master a Cloud Native Standard - MicroProfile.pdf

More Related Content

PDF
Master a Cloud Native Standard - MicroProfile.pdf
PPTX
Master a Cloud Native Standard - MicroProfile.pptx
PPTX
Building 12-factor Cloud Native Microservices
PPTX
Cloud nativemicroservices jax-london2020
PPTX
Cloud nativemicroservices jax-london2020
PDF
Live Coding 12 Factor App
PPTX
TechEvent Eclipse Microprofile
PPTX
Cloud nativeworkshop
Master a Cloud Native Standard - MicroProfile.pdf
Master a Cloud Native Standard - MicroProfile.pptx
Building 12-factor Cloud Native Microservices
Cloud nativemicroservices jax-london2020
Cloud nativemicroservices jax-london2020
Live Coding 12 Factor App
TechEvent Eclipse Microprofile
Cloud nativeworkshop

Similar to Master a Cloud Native Standard - MicroProfile.pdf (20)

PDF
DevNexus 2019: MicroProfile and Jakarta EE - What's Next?
PPTX
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
PPTX
Cloud native programming model comparison
PDF
Spring boot microservice metrics monitoring
PDF
Spring Boot - Microservice Metrics Monitoring
PPTX
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
PDF
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Jforum S...
PDF
Challenges in a Microservices Age: Monitoring, Logging and Tracing on Red Hat...
PPTX
Introduction to Eclipse Microprofile
PDF
Stmik bandung
PPTX
Build12 factorappusingmp
PDF
Jetpack, with new features in 2021 GDG Georgetown IO Extended
PDF
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
PDF
Scale and Load Testing of Micro-Service
PPTX
The new and smart way to build microservices - Eclipse MicroProfile
PPTX
ThroughTheLookingGlass_EffectiveObservability.pptx
PPTX
Observability and Orchestration of your GitOps Deployments with Keptn
PDF
Red hat forum istio & kiali - introduction and overview
PPTX
Eclipse micro profile
PPTX
MicroProfile as the Istio Programming Model | Virtual Eclipse Community Meetup
DevNexus 2019: MicroProfile and Jakarta EE - What's Next?
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
Cloud native programming model comparison
Spring boot microservice metrics monitoring
Spring Boot - Microservice Metrics Monitoring
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Jforum S...
Challenges in a Microservices Age: Monitoring, Logging and Tracing on Red Hat...
Introduction to Eclipse Microprofile
Stmik bandung
Build12 factorappusingmp
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
Scale and Load Testing of Micro-Service
The new and smart way to build microservices - Eclipse MicroProfile
ThroughTheLookingGlass_EffectiveObservability.pptx
Observability and Orchestration of your GitOps Deployments with Keptn
Red hat forum istio & kiali - introduction and overview
Eclipse micro profile
MicroProfile as the Istio Programming Model | Virtual Eclipse Community Meetup
Ad

More from EmilyJiang23 (6)

PDF
Hybrid Cloud Application Development without vendor lockin
PDF
What need to be mastered as AI-Powered Java Developers
PDF
LJC-Unconference-2023-Keynote.pdf
PPTX
OpenCloudNative-BeJUG.pptx
PPTX
JakartaData-JCon.pptx
PDF
WillMicroserviceDie.pdf
Hybrid Cloud Application Development without vendor lockin
What need to be mastered as AI-Powered Java Developers
LJC-Unconference-2023-Keynote.pdf
OpenCloudNative-BeJUG.pptx
JakartaData-JCon.pptx
WillMicroserviceDie.pdf
Ad

Recently uploaded (20)

PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
MYSQL Presentation for SQL database connectivity
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPT
Teaching material agriculture food technology
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
KodekX | Application Modernization Development
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Reach Out and Touch Someone: Haptics and Empathic Computing
NewMind AI Weekly Chronicles - August'25 Week I
MYSQL Presentation for SQL database connectivity
NewMind AI Monthly Chronicles - July 2025
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Mobile App Security Testing_ A Comprehensive Guide.pdf
Empathic Computing: Creating Shared Understanding
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Teaching material agriculture food technology
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
Network Security Unit 5.pdf for BCA BBA.
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
KodekX | Application Modernization Development
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto

Master a Cloud Native Standard - MicroProfile.pdf

  • 1. Emily Jiang, Java Champion IBM, STSM, Cloud Native Architect and Advocate X/LinkedIn: @emilyfhjiang 14th June 2024 Master a Cloud Native Application Standard: MicroProfile
  • 6. MicroProfile 1.0 (Fall 2016) MicroProfile 1.1 (Aug. 2017) MicroProfile 1.2 (Sept 2017) 2017 2018 MicroProfile 1.3 (Dec 2017) MicroProfile 1.4 (June 2018) 2019 MicroProfile 2.0.1 (July 2018) MicroProfile 2.1 (Oct 2018) MicroProfile 2.2 (Feb 2019) MicroProfile 3.0 (June 2019) MicroProfile 3.2 (Nov 2019) 2020 MicroProfile 3.3 (Feb 2020) MicroProfile 4.0 (Oct. 2020) MicroProfile 4.1 (July. 2021) MicroProfile 5.0 (Dec. 2021) Config 3.0 Metrics 4.0 Fault Tolerance 4.0 Health 4.0 Rest Client 3.0 OpenAPI 3.0 OpenTracing 3.0 JWT Auth 2.0 Jakarta CDI 3.0 //Jakarta EE 9.1 Jakarta RESTful Web Services //Jakarta EE 9.1 Jakarta JSON-P //Jakarta EE 9.1 Jakarta JSON-B 2.0 //Jakarta EE 9.1 Jakarta Annotations 2.0 //Jakarta EE 9.1 2022 2021 MicroProfile 6.0 (Dec. 2022) Config 3.0 Metrics 5.0 Fault Tolerance 4.0 Health 4.0 Rest Client 3.0 OpenAPI 3.1 Telemetry 1.0 JWT Auth 2.1 Jakarta EE 10 Core Profile MicroProfile 6.1 (Oct. 2023) Config 3.1 Metrics 5.1 Fault Tolerance 4.0 Health 4.0 Rest Client 3.0 OpenAPI 3.1 Telemetry 1.1 JWT Auth 2.1 Jakarta EE 10 Core Profile 2023 2024 MicroProfile 7.0 (2024) Config 3.1 Fault Tolerance 4.1 Health 4.0 Rest Client 4.0 OpenAPI 4.0 Telemetry 2.0 JWT Auth 2.1
  • 7. MicroProfile Health Metrics Fault Tolerance Open API Config Telemetry JWT Rest Client GraphQL Reactive Streams Operators Reactive Messaging Context Propagation Platform Release Standalone Release Jakarta EE Core Profile LRA Open Tracing
  • 8. MicroProfile 6.1 in Oct. 2023 Health 4.0 Metrics 5.1 Fault Tolerance 4.0 Open API 3.1 Config 3.1 Telemetry 1.1 JWT 2.1 Rest Client 3.0 Jakarta EE 10 Core Profile Updated specs Unchanged specs Jakarta EE 10 Core Profile specs Core Integrate Observe
  • 9. MicroProfile 7.0 in 2024 Health 4.0 Fault Tolerance 4.1 Open API 4.0 Config 3.1 Telemetry 2.0 JWT 2.1 Rest Client 4.0 Jakarta EE 10 Core Profile Updated specs Unchanged specs Jakarta EE 10 Core Profile specs Core Integrate Observe – The release date is subject to change.
  • 10. Agenda 01 02 03 10 IBM TechXchange / © 2023 IBM Corporation MicroProfile background MicroProfile Deep Dive MicroProfile future
  • 11. 11 Use case: As a developer, I need to create a microservice working in a cloud.
  • 12. Jakarta REST B @ApplicationPath("System") public class SystemApplication extends Application {} @Path("properties") public class PropertiesResource { @GET @Produces(MediaType.APPLICATION_JSON) public JsonObject getProperties() {…} }
  • 13. 13 I need to configure my services in my deployment environment
  • 14. A MicroProfile Config B @Inject @ConfigProperty(name = "inMaintenance") private Provider<Boolean> inMaintenance; config_ordinal=100 inMaintenance=false { "config_ordinal":150, "inMaintenance":true } https://github.com/eclipse/microprofile-config/
  • 15. 15 I want to call other microservices
  • 16. MicroProfile REST Client B A @Inject @RestClient private SystemClient defaultRestClient; @Dependent @RegisterRestClient @RegisterProvider(UnknownUrlExceptionMapper.class) @Path("/properties") public interface SystemClient { @GET @Produces(MediaType.APPLICATION_JSON) public Properties getProperties() throws UnknownUrlException, ProcessingException; } io.openliberty.guides.inventory.client.SystemClient/mp-rest/url=http://localhost:9080/system https://github.com/eclipse/microprofile-rest-client
  • 17. 17 What does the service do?
  • 18. MicroProfile OpenAPI A B openapi: 3.0.0 info: title: Inventory App description: App for storing JVM system properties of various hosts. license: name: Eclipse Public License - v 1.0 url: https://www.eclipse.org/legal/epl-v10.html version: "1.0" servers: - url: http://localhost:{port} description: Simple Open Liberty. variables: port: description: Server HTTP port. default: "9080" paths: /inventory/systems: get: summary: List inventory contents. description: Returns the currently stored host:properties pairs in the inventory. operationId: listContents responses: 200: description: host:properties pairs stored in the inventory. content: application/json: schema: $ref: '#/components/schemas/InventoryList’ …. http://localhost:9080/openapi/ui https://github.com/eclipse/microprofile-open-api/
  • 19. 19 I need to provide a good response to my clients no matter what happens.
  • 20. MicroProfile Fault Tolerance A B @Fallback(fallbackMethod = "fallbackForGet") public Properties get(String hostname) throws IOException { return invUtils.getProperties(hostname); } https://github.com/eclipse/microprofile-fault-tolerance/
  • 21. MicroProfile Fault Tolerance – The annotations can be used together. – When MicroProfile Metrics is enabled, their usages are monitored. – The values can be configured via MicroProfile Config. @Retry @Timeout @CircuitBreaker @Bulkhead @Asynchronous @Fallback
  • 22. 22 I need to protect my services to prevent from unauthorized access
  • 23. MicroProfile JWT A B @GET @RolesAllowed({ "admin", "user" }) @Path("{hostname}") @Produces(MediaType.APPLICATION_JSON) public Response getPropertiesForHost(@PathParam("hostname") String hostname, @Context HttpHeaders httpHeaders) {…} https://github.com/eclipse/microprofile-jwt-auth/
  • 24. 24 I need to ensure they work in the Cloud and observe them.
  • 25. MicroProfile Health Metrics Fault Tolerance Open API Config Telemetry JWT Rest Client Jakarta EE Core Profile
  • 26. 26 I need my service to communicate with Kubernetes so that requests can be routed when my service is ready.
  • 27. MicroProfile Health A B @Readiness @ApplicationScoped public class InventoryResource implements HealthCheck { ... public boolean isHealthy() {...} @Override public HealthCheckResponse call() { if (!isHealthy()) { return HealthCheckResponse.named(“ServiceHealthCheck”).withData(…).down().build(); } return HealthCheckResponse.named(“ServiceHealthCheck”).withData(…).up().build(); } } https://github.com/eclipse/microprofile-health/
  • 28. MicroProfile Health 3.1 Startup Probe Liveness Probe Readiness Probe mpHealth-3.1 feature Application provided health checks /health /health/ready /health/live Health Check D @Readiness Health Check E @Readiness Health Check C @Liveness /health/started Health Check A @Startup Health Check B @Startup Application 1 HTTP GET In Kubernetes, when the startup probe is configured, the liveness and readiness checks are disabled, until it succeeds. Kubernetes
  • 29. 29 I need to know how my service is performing.
  • 30. MicroProfile Metrics A B @Timed(name = "inventoryPropertiesRequestTime”, description = "Time needed to get the properties of" + "a system from the given hostname") public Properties get(String hostname) { return invUtils.getProperties(hostname); } https://github.com/eclipse/microprofile-metrics/
  • 31. MicroProfile Metrics 5.1 Influenced by Micrometer All metrics are under /metrics endpoint. Data is returned from /metrics calls in the Prometheus 0.0.4 exposition format. Implementation can use Micrometer or OpenTelemetry Metrics
  • 32. MicroProfile Metrics 5.1 Liberty mpMetrics-5.1 • Tracks metrics from Liberty components and the JVM to help you understand how your servers are performing. • Provides the MicroProfile Metrics API, which you can use to add metrics to your applications. • Provides the ability to group application metrics into custom scopes and allows querying of metrics by those scopes. • Is based on Micrometer - can ship metrics to your choice of monitoring systems (currently including AppOptics, Azure Monitor, Netflix Atlas, CloudWatch, Datadog, Dynatrace, Elastic, Ganglia, Graphite, Humio, Influx/Telegraf, JMX, KairosDB, New Relic, Prometheus, SignalFx, Google Stackdriver, StatsD, and Wavefront.) Micrometer and Prometheus meter registry included in mpMetrics-5.0. Provide other meter registries if you want to connect to a different monitoring system.
  • 33. 33 I need to identify the root cause if something goes wrong.
  • 34. MicroProfile Telemetry A B @WithSpan(name=“list”) public InventoryList list() { return new InventoryList(systems); } Jakarta REST methods are automatically traced by default https://github.com/eclipse/microprofile-telemetry/
  • 35. MicroProfile Telemetry 35 • Adopts OpenTelemetry Tracing • Set of APIs, SDKs, tooling and integrations • Designed for the creation and management of telemetry data (traces, metrics, and logs) • Supports 3 instrumentations: • Manual • Automatic • Java Agent
  • 36. MicroProfile Telemetry • Support Java agent instrumentation -javaagent:opentelemetry-javaagent.jar -Dotel.service.name=<name> -Dotel.traces.exporter=jaeger -Dotel.instrumentation.opentelemetry-api.enabled=false • Automatically tracing of REST (server and client) calls, and MicroProfile REST Client calls without code modification. • Manual instrumentation using OpenTelemetry API –@WithSpan –@SpanAttribute –@Inject io.opentelemetry.api.OpenTelemetry –@Inject io.opentelemetry.api.trace.Tracer –@Inject io.opentelemetry.api.trace.Span –@Inject io.opentelemetry.api.baggage.Baggage java -javaagent:path/to/opentelemetry-javaagent.jar -Dotel.service.name=your-service-name -Dotel.traces.exporter=zipkin -jar myapp.jar
  • 37. How MP Telemetry works – https://openliberty.io/guides/microprofile-telemetry-jaeger.html
  • 38. 38 Done the development. Time to deploy to my chosen Cloud. How to do it?
  • 39. Cloud-Native Application Deployment Kubernetes Istio Docker or Podman Health Metrics Fault Tolerance Open API Config Open Tracing JWT Rest Client Jakarta EE Core Profile
  • 40. MicroProfile Config with Kubernetes A B env: - name: GREETING valueFrom: configMapKeyRef: name: greeting-config key: message kubectl create configmap greeting-config --from-literal message=Hello... @Inject @ConfigProperty(name = "GREETING") private String greeting;
  • 41. MicroProfile Health with Kubernetes A B readinessProbe: httpGet: path: /health/ready port: 9080 initialDelaySeconds: 15 periodSeconds: 5 failureThreshold: 1
  • 42. MicroProfile Metrics with Kubernetes A B @POST @Counted(name="order", displayName="Order count", description="Number of times orders requested.") public Response orderCoffee(@Valid @NotNull CoffeeOrder order) { ... } Data in OpenMetrics format Collect and store data with Prometheus Visualize data with Grafana
  • 43. MicroProfile Telemetry 7 HTTP headers required by Istio propagated All Jakarta REST requests traced
  • 44. Istio & MicroProfile - Putting it all together
  • 45. 45 I need to create a reactive microservice.
  • 46. MicroProfile Reactive Messaging MicroProfile Reactive Messaging relies on MicroProfile Reactive Operators
  • 47. MicroProfile Reactive Messaging The MicroProfile Reactive Messaging API provides a simple way to configure the streams and event queues using annotations – https://openliberty.io/guides/microprofile-reactive-messaging.html
  • 48. MicroProfile Reactive Messaging 3.0 Imperative code bridges with reactive code
  • 49. 49 How to do transactions in microservices? SAGA pattern?
  • 50. MicroProfile LRA • Cloud Native Transaction model based on compensating Saga model • Loosely coupled µServices with eventually consistent data LRA Coordinator µS A µS B µS C • Orchestration via a Coordinator Service that Participant µServices registers with • Annotations for joining, completing and compensating transactions
  • 51. MicroProfile LRA Need to maintain data consistency across multiple µservices where each has their own data. The multiple operations form the atomic action which needs to be processed together In the case of failures compensation actions are invoked Flight µS Book Taxi µS Hotel µS Book Book Flight µS Taxi µS Hotel µS Confirm Confirm Confirm Start LRA End LRA Successful Flight µS Book Taxi µS Hotel µS Book Book Flight µS Book Taxi µS Hotel µS Book Book Flight µS Taxi µS Failed Compensate Compensate Start LRA End LRA ❌ Error In the case of success, complete actions are invoked
  • 52. 52 I need to frequently query/update data. What should I do?
  • 53. MicroProfile GraphQL • Avoiding over-fetching or under-fetching data. • Enabling data models to evolve, schema driven. • Provide a "code-first" set of APIs that will enable users to quickly develop portable GraphQL-based applications in Java – GraphQL Entities Scalars, or simple type Enumerable types (similar to Java Enum) Complex objects : scalars and/or enums and/or other complex objects and/or collections of these. – GraphQL Components – @GraphQLApi : GraphQL endpoints must be annotated with the @GraphQLApi annotation. – @Query: allows a user to ask for all or specific fields on an object or collection of objects. – @Mutation: create new entities or update or delete existing entities. – https://openliberty.io/guides/microprofile-graphql.html
  • 54. 54 I am convinced to use MicroProfile. Where to start?
  • 55. How to get started? https://start.microprofile.io/
  • 57. 57 Are there any learning materials?
  • 58. Learning materials – https://openliberty.io/guides/?search=microprofile – https://github.com/Emily-Jiang/jcon – https://microprofile.io/
  • 59. 59 MicroProfile Book featured Open Liberty https://ibm.biz/MicroProfileBook Twitter/LinkedIn: @emilyfhjiang
  • 60. Agenda 01 02 03 60 IBM TechXchange / © 2023 IBM Corporation MicroProfile background MicroProfile Deep Dive MicroProfile future
  • 61. MicroProfile in 2024 ● MicroProfile 7.0 in 3Q 2024 ○ Adopt OpenTelemetry Metrics in MicroProfile Telemetry 2.0 ○ Move MicroProfile Metrics to be a standalone spec ○ Make Jakarta EE Core Profile dependency loosely coupled ○ The updated specifications: Telemetry 2.0, Fault Tolerance 4.1, OpenAPI 4.0, Rest Client 4.0 ● New specifications ○ Evaluate a new specification: AI with the focus on LLM ■ If interested, join the weekly Monday AI group discussions 61
  • 62. 62 Q&A Emily Jiang IBM, Cloud Native Architect & Advocate emijiang@uk.ibm.com X/LinkedIn: @emilyfhjiang