Emily Jiang presents on MicroProfile, a community-driven set of lightweight Java APIs for building microservices. MicroProfile aims to provide APIs for common concerns like configuration, fault tolerance, health checking, and more to help build cloud-native Java microservices. It has wide vendor support and specifications are developed through an open community process. MicroProfile services can be deployed to modern platforms like Kubernetes and service meshes like Istio to enable scalable and resilient microservice architectures in the cloud.
1 of 36
Download to read offline
More Related Content
The new and smart way to build microservices - Eclipse MicroProfile
1. 1@emilyfhjiang
A new and smart way to develop cloud-native
microservices - MicroProfile
STSM, Liberty Architect of Microservicers, Advocate
Liberty leadArchitect for MicroProfile and CDI, IBM
@emilyfhjiang
2. 2@emilyfhjiang
About Emily Jiang
2
Java Champion
STSM, IBM, Liberty Lead Architect for MicroProfile and CDI
Leads MicroProfile Config, Fault Tolerance, Service Mesh
Co-spec lead for Config JSR
CDI Expert Group
Based in IBMs Hursley lab, UK
Email: emijiang@uk.ibm.com
https://www.linkedin.com/in/emily-jiang-60803812/
5. 5@emilyfhjiang
Java in Cloud
Hotspot OpenJ9 OpenJ9 -Xshareclasses -
Xquickstart
Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart
Footprint is 60% smaller with OpenJ9
Hotspot OpenJ9 OpenJ9 -Xshareclasses -
Xquickstart
Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart
Startup time is 30% faster with
OpenJ9 Xshareclasses -Xquickstart
5
Java in Cloud
Hotspot OpenJ9 OpenJ9 -Xshareclasses -
Xquickstart
Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart
Footprint is 60% smaller with OpenJ9
Hotspot OpenJ9 OpenJ9 -Xshareclasses -
Xquickstart
Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart
Startup time is 30% faster with
OpenJ9 Xshareclasses -Xquickstart
6. 6@emilyfhjiang
cloud-native microservice
1. RESTful like cattle not pet, communicative
2. Configurable
3. Fault tolerance
4. Can be discovered
5. Secure
6. Traceable, monitorable
7. Able to communicate with the cloud infrastructure
8. 8@emilyfhjiang
Open specifications
Wide vendor support
REST services
OpenAPI support
Security
Fault Tolerance
Configuration
Metrics
Health
Open Tracing
https://wiki.eclipse.org/MicroProfile/Implementation
Quarkus
11. 11@emilyfhjiang
Health CheckMetrics Open Tracing
JAX-RS JSON-PCDI
Config
Fault
Tolerance
JWT
Propagation
Open API
Rest Client JSON-B
MicroProfile Specifications
20. 20@emilyfhjiang
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
21. 21@emilyfhjiang
MicroProfile JWT
A B
@GET
@RolesAllowed({ "admin", "user" })
@Path("{hostname}")
@Produces(MediaType.APPLICATION_JSON)
public Response getPropertiesForHost(@PathParam("hostname") String hostname,
@Context HttpHeaders httpHeaders) {}
22. 22@emilyfhjiang
MicroProfile Fault Tolerance
A B
@Fallback(fallbackMethod = "fallbackForGet")
public Properties get(String hostname) throws
IOException {
return invUtils.getProperties(hostname);
}
26. 26@emilyfhjiang
MicroProfile Health
A B
@Health
@ApplicationScoped
public class InventoryResource implements HealthCheck {
...
public boolean isHealthy() {...}
@Override
public HealthCheckResponse call() {
if (!isHealthy()) {
return
HealthCheckResponse.named(InventoryResource).withData().down().build();
}
return
HealthCheckResponse.named(InventoryResource).withData().up().build();
}
}
27. 27@emilyfhjiang
MicroProfile Metrics
A B
@Timed(name = "inventoryPropertiesRequestTime",
absolute = true,
description = "Time needed to get the properties of" +
"a system from the given hostname")
public Properties get(String hostname) {
return invUtils.getProperties(hostname);
}
33. 33@emilyfhjiang
MicroProfile Health with Kubernetes
A B
readinessProbe:
httpGet:
path: /health
port: 9080
initialDelaySeconds: 15
periodSeconds: 5
failureThreshold: 1
34. 34@emilyfhjiang
Upcoming IBM event on modernization
JNation
Europe Application, Platform & Modernization Hursley Summit
9-10th September
Registration: ibm.bz/APMSummit