SlideShare a Scribd company logo
Emily Jiang, Java Champion
IBM, STSM, Cloud Native Architect and Advocate
16th May 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 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/
21
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
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
Reactive Messaging is based on Reactive Streams 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
process 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
Twitter/LinkedIn: @emilyfhjiang
Master a Cloud Native Standard - MicroProfile.pdf

More Related Content

Similar to Master a Cloud Native Standard - MicroProfile.pdf

MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexusMicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
Emily Jiang
 
Cloud native programming model comparison
Cloud native programming model comparisonCloud native programming model comparison
Cloud native programming model comparison
Emily Jiang
 
Spring boot microservice metrics monitoring
Spring boot   microservice metrics monitoringSpring boot   microservice metrics monitoring
Spring boot microservice metrics monitoring
Oracle Korea
 
Spring Boot - Microservice Metrics Monitoring
Spring Boot - Microservice Metrics MonitoringSpring Boot - Microservice Metrics Monitoring
Spring Boot - Microservice Metrics Monitoring
DonghuKIM2
 
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveDataAndroid MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
Waheed Nazir
 
Challenges in a Microservices Age: Monitoring, Logging and Tracing on Red Hat...
Challenges in a Microservices Age: Monitoring, Logging and Tracing on Red Hat...Challenges in a Microservices Age: Monitoring, Logging and Tracing on Red Hat...
Challenges in a Microservices Age: Monitoring, Logging and Tracing on Red Hat...
Martin Etmajer
 
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Jforum S...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Jforum S...Microservices for the Masses with Spring Boot, JHipster, and OAuth - Jforum S...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Jforum S...
Matt Raible
 
Introduction to Eclipse Microprofile
Introduction to Eclipse MicroprofileIntroduction to Eclipse Microprofile
Introduction to Eclipse Microprofile
Red Hat Developers
 
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
Toru Wonyoung Choi
 
Build12 factorappusingmp
Build12 factorappusingmpBuild12 factorappusingmp
Build12 factorappusingmp
Emily Jiang
 
Scale and Load Testing of Micro-Service
Scale and Load Testing of Micro-ServiceScale and Load Testing of Micro-Service
Scale and Load Testing of Micro-Service
IRJET Journal
 
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
Matt Raible
 
Stmik bandung
Stmik bandungStmik bandung
Stmik bandung
farid savarudin
 
The new and smart way to build microservices - Eclipse MicroProfile
The new and smart way to build microservices - Eclipse MicroProfileThe new and smart way to build microservices - Eclipse MicroProfile
The new and smart way to build microservices - Eclipse MicroProfile
Emily Jiang
 
ThroughTheLookingGlass_EffectiveObservability.pptx
ThroughTheLookingGlass_EffectiveObservability.pptxThroughTheLookingGlass_EffectiveObservability.pptx
ThroughTheLookingGlass_EffectiveObservability.pptx
Grace Jansen
 
Observability and Orchestration of your GitOps Deployments with Keptn
Observability and Orchestration of your GitOps Deployments with KeptnObservability and Orchestration of your GitOps Deployments with Keptn
Observability and Orchestration of your GitOps Deployments with Keptn
Andreas Grabner
 
Eclipse micro profile
Eclipse micro profileEclipse micro profile
Eclipse micro profile
HOCiNE Bekkouche
 
Api RESTFull
Api RESTFullApi RESTFull
Api RESTFull
Germán Küber
 
Don't Deploy Into the Dark: DORA Metrics for your K8s GitOps Deployments
Don't Deploy Into the Dark: DORA Metrics for your K8s GitOps DeploymentsDon't Deploy Into the Dark: DORA Metrics for your K8s GitOps Deployments
Don't Deploy Into the Dark: DORA Metrics for your K8s GitOps Deployments
Andreas Grabner
 
Microservices for the Masses with Spring Boot, JHipster, and OAuth - South We...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - South We...Microservices for the Masses with Spring Boot, JHipster, and OAuth - South We...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - South We...
Matt Raible
 

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

MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexusMicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
 
Cloud native programming model comparison
Cloud native programming model comparisonCloud native programming model comparison
Cloud native programming model comparison
 
Spring boot microservice metrics monitoring
Spring boot   microservice metrics monitoringSpring boot   microservice metrics monitoring
Spring boot microservice metrics monitoring
 
Spring Boot - Microservice Metrics Monitoring
Spring Boot - Microservice Metrics MonitoringSpring Boot - Microservice Metrics Monitoring
Spring Boot - Microservice Metrics Monitoring
 
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveDataAndroid MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
 
Challenges in a Microservices Age: Monitoring, Logging and Tracing on Red Hat...
Challenges in a Microservices Age: Monitoring, Logging and Tracing on Red Hat...Challenges in a Microservices Age: Monitoring, Logging and Tracing on Red Hat...
Challenges in a Microservices Age: Monitoring, Logging and Tracing on Red Hat...
 
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Jforum S...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Jforum S...Microservices for the Masses with Spring Boot, JHipster, and OAuth - Jforum S...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Jforum S...
 
Introduction to Eclipse Microprofile
Introduction to Eclipse MicroprofileIntroduction to Eclipse Microprofile
Introduction to Eclipse Microprofile
 
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
 
Build12 factorappusingmp
Build12 factorappusingmpBuild12 factorappusingmp
Build12 factorappusingmp
 
Scale and Load Testing of Micro-Service
Scale and Load Testing of Micro-ServiceScale and Load Testing of Micro-Service
Scale and Load Testing of Micro-Service
 
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
 
Stmik bandung
Stmik bandungStmik bandung
Stmik bandung
 
The new and smart way to build microservices - Eclipse MicroProfile
The new and smart way to build microservices - Eclipse MicroProfileThe new and smart way to build microservices - Eclipse MicroProfile
The new and smart way to build microservices - Eclipse MicroProfile
 
ThroughTheLookingGlass_EffectiveObservability.pptx
ThroughTheLookingGlass_EffectiveObservability.pptxThroughTheLookingGlass_EffectiveObservability.pptx
ThroughTheLookingGlass_EffectiveObservability.pptx
 
Observability and Orchestration of your GitOps Deployments with Keptn
Observability and Orchestration of your GitOps Deployments with KeptnObservability and Orchestration of your GitOps Deployments with Keptn
Observability and Orchestration of your GitOps Deployments with Keptn
 
Eclipse micro profile
Eclipse micro profileEclipse micro profile
Eclipse micro profile
 
Api RESTFull
Api RESTFullApi RESTFull
Api RESTFull
 
Don't Deploy Into the Dark: DORA Metrics for your K8s GitOps Deployments
Don't Deploy Into the Dark: DORA Metrics for your K8s GitOps DeploymentsDon't Deploy Into the Dark: DORA Metrics for your K8s GitOps Deployments
Don't Deploy Into the Dark: DORA Metrics for your K8s GitOps Deployments
 
Microservices for the Masses with Spring Boot, JHipster, and OAuth - South We...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - South We...Microservices for the Masses with Spring Boot, JHipster, and OAuth - South We...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - South We...
 

More from EmilyJiang23

Hybrid Cloud Application Development without vendor lockin
Hybrid Cloud Application Development without vendor lockinHybrid Cloud Application Development without vendor lockin
Hybrid Cloud Application Development without vendor lockin
EmilyJiang23
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java Developers
EmilyJiang23
 
LJC-Unconference-2023-Keynote.pdf
LJC-Unconference-2023-Keynote.pdfLJC-Unconference-2023-Keynote.pdf
LJC-Unconference-2023-Keynote.pdf
EmilyJiang23
 
OpenCloudNative-BeJUG.pptx
OpenCloudNative-BeJUG.pptxOpenCloudNative-BeJUG.pptx
OpenCloudNative-BeJUG.pptx
EmilyJiang23
 
JakartaData-JCon.pptx
JakartaData-JCon.pptxJakartaData-JCon.pptx
JakartaData-JCon.pptx
EmilyJiang23
 
WillMicroserviceDie.pdf
WillMicroserviceDie.pdfWillMicroserviceDie.pdf
WillMicroserviceDie.pdf
EmilyJiang23
 

More from EmilyJiang23 (6)

Hybrid Cloud Application Development without vendor lockin
Hybrid Cloud Application Development without vendor lockinHybrid Cloud Application Development without vendor lockin
Hybrid Cloud Application Development without vendor lockin
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java Developers
 
LJC-Unconference-2023-Keynote.pdf
LJC-Unconference-2023-Keynote.pdfLJC-Unconference-2023-Keynote.pdf
LJC-Unconference-2023-Keynote.pdf
 
OpenCloudNative-BeJUG.pptx
OpenCloudNative-BeJUG.pptxOpenCloudNative-BeJUG.pptx
OpenCloudNative-BeJUG.pptx
 
JakartaData-JCon.pptx
JakartaData-JCon.pptxJakartaData-JCon.pptx
JakartaData-JCon.pptx
 
WillMicroserviceDie.pdf
WillMicroserviceDie.pdfWillMicroserviceDie.pdf
WillMicroserviceDie.pdf
 

Recently uploaded

ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 

Recently uploaded (20)

ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 

Master a Cloud Native Standard - MicroProfile.pdf

  • 1. Emily Jiang, Java Champion IBM, STSM, Cloud Native Architect and Advocate 16th May 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 protect my services to prevent from unauthorized access
  • 20. 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/
  • 21. 21 I need to provide a good response to my clients no matter what happens.
  • 22. 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/
  • 23. 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
  • 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 Reactive Messaging is based on Reactive Streams 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 process 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 Twitter/LinkedIn: @emilyfhjiang