SlideShare a Scribd company logo
@CesarHgt @ivanjunckes @tomitribe
César Hernández, Ivan Junckes Filho
Type-Safe Approach to Invoking RESTful
Services with MicroProfile Rest Client
@CesarHgt @ivanjunckes @tomitribe
SPEAKERS
César Hernández
● Senior Software Engineer at Tomitribe
● Java Champion
● Duke’s Choice Award 2016, 2017
● Oracle Certified Professional
● +10 experience with Java EE
● Eclipse Committer: Jakarta EE TCK,
JAX-WS and Microprofile.
● Open Source advocate, teacher and
public speaker
Ivan Junckes
● Software Engineer at Tomitribe
● Oracle Certified Professional
● 9+ years experience with JavaEE
● Eclipse Committer: JnoSQL, JPA, JSONB
and JSP
● Member of GujavaSC
@CesarHgt @ivanjunckes @tomitribe
Slides and resources
@CesarHgt @ivanjunckes @tomitribe
@CesarHgt @ivanjunckes @tomitribe
Eclipse MicroProfile
● An open-source community specification
● Focus on Enterprise Java microservices
● Generates: SPEC, API, and TCK.
● https://microprofile.io
● Implemented by different vendors.
@CesarHgt @ivanjunckes @tomitribe
Eclipse MicroProfile
MicroProfile 2.1
JAX-RS 2.1JSON-P 1.1CDI 2.0
Config 1.3
Fault
Tolerance 1.1
JWT
Propagation
1.1
Health
Check 1.0
Metrics 1.1
Open
Tracing 1.2
Open API
1.0
= Updated
= No change from last release (MicroProfile 2.0)
Rest Client
1.1
JSON-B 1.0
Rest Client
1.1
Open
Tracing 1.2
@CesarHgt @ivanjunckes @tomitribe
So far...
@CesarHgt @ivanjunckes @tomitribe
RESTful client API’s so far in Java
● JAX-RS
○ Jersey
○ Apache CXF
○ RestEasy
● Others client implementations
○ Apache HttpComponents
○ Spring
○ Unirest
○ java.net.HttpURLConnection ?
https://jersey.github.io/documentation/latest/client.html
http://cxf.apache.org/docs/jax-rs-client-api.html
http://hc.apache.org/
@CesarHgt @ivanjunckes @tomitribe
htps://blogs.oracle.com/theaquarium/java-ee-8-community-survey-results-and-next-steps
Why we have
so many
options?
@CesarHgt @ivanjunckes @tomitribe
@CesarHgt @ivanjunckes @tomitribe
● Java 8
● Maven 3.9
● Apache TomEE 8.0.0-M1
● Rest Client for MicroProfile 1.1
● Inget 1.0
Demo architecture
@CesarHgt @ivanjunckes @tomitribe
Tests included on
movie-app/services module.
○ Jersey
○ Apache CXF
○ Apache HttpComponents
movie-app/services/MoviesResource.java
/GET movies
/GET movies/{id}
/GET movies/count
/POST movies
/PUT movies/{id}
@CesarHgt @ivanjunckes @tomitribe
@CesarHgt @ivanjunckes @tomitribe
MicroProfile Rest Client
● Type safe approach based on interfaces
● Implicit transformation
● Uses JAX-RS 2.0 APIs
● Lastest version: 1.1
○ Asynchronous Methods
○ RestClientBuilderListener
○ Supports java.net.URI in addition to java.net.URL.
○ @RegisterRestClient is now a bean-defining annotation
● https://microprofile.io/project/eclipse/microprofile-rest-client
@CesarHgt @ivanjunckes @tomitribe
helloWorld.mp.restClient();
@CesarHgt @ivanjunckes @tomitribe
pom.xml
<dependency>
<groupId>org.apache.tomee</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>1.3</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
@CesarHgt @ivanjunckes @tomitribe
@CesarHgt @ivanjunckes @tomitribe
More problems...
● Copy / pasting everything would be very boring
● Easy to make mistakes
● Microservices evolve too fast
● Maintaining a client would be a nightmare
● Cost is too high
@CesarHgt @ivanjunckes @tomitribe
@radcortez @ivanjunckes @tomitribe
Inget
@radcortez @ivanjunckes @tomitribe
Inget
● Open source project
● Model (Amazon-style)
● Resource
● Client
● Command-line Interface (CLI)
● Documentation
@radcortez @ivanjunckes @tomitribe
Evolving the demo architecture
movie-app
cinema-desktop-app
cinema-webapp
client
client client
Generates
@radcortez @ivanjunckes @tomitribe
Evolving the demo architecture
@CesarHgt @ivanjunckes @tomitribe
movie-app/client/pom.xml
<dependency>
<groupId>org.tomitribe.inget</groupId>
<artifactId>inget-client-java</artifactId>
<version>${version.inget}</version>
</dependency>
@CesarHgt @ivanjunckes @tomitribe
movie-app/client/pom.xml<plugin>
<groupId>org.tomitribe.inget</groupId>
<artifactId>inget-maven-plugin</artifactId>
<version>${version.inget}</version>
<configuration>
<modelPackage>org.superbiz.moviefun.model</modelPackage>
<resourcePackage>org.superbiz.moviefun.rest</resourcePackage>
<resourceSuffix>Resource</resourceSuffix>
<generateClient>true</generateClient>
<clientName>MovieClient</clientName>
</configuration>
<executions>
<execution>
<id>gen</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
@CesarHgt @ivanjunckes @tomitribe
@CesarHgt @ivanjunckes @tomitribe
What’s next in version 1.2?
● Enhancement
○ Header and cookies propagation (JWT header)
○ Make interface type available to providers
○ CDI Interceptor support
○ Non generated config keys for @RegisterRESTClient
○ Spec clarifications
● Future:
○ JAX-RS 2.1
https://github.com/eclipse/microprofile-rest-client/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Aenhancement
@CesarHgt @ivanjunckes @tomitribe
Thank you

More Related Content

PPTX
The New York Times: Sustainable Systems, Powered by Python
PDF
Testing cloud and kubernetes applications - ElasTest
PDF
Magento Continuous Integration & Continuous Delivery @MM17HR
PDF
Chasing the RESTful Trinity - Client CLI and Documentation
PPTX
Advantages and disadvantages of a monorepo
PDF
codemotion-docker-2014
PPTX
Mono Repo
PPTX
Master the Monorepo
The New York Times: Sustainable Systems, Powered by Python
Testing cloud and kubernetes applications - ElasTest
Magento Continuous Integration & Continuous Delivery @MM17HR
Chasing the RESTful Trinity - Client CLI and Documentation
Advantages and disadvantages of a monorepo
codemotion-docker-2014
Mono Repo
Master the Monorepo

What's hot (20)

PPT
Continuous Integration
PDF
GraalVM and MicroProfile - A Polyglot Microservices Solution
PPTX
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
PPTX
'MICROFRONTENDS WITH REACT' by Liliia Karpenko
PPTX
What can possibly go wrong if i dont e2 e test my packages?
PDF
Microservices in Golang
PDF
Using Mountebank to inject behavior into test stubs
ODP
Continuous Integration and PHP
PDF
Continuous integration & Continuous Delivery @DeVz
ODP
Neo4j Graph Database, from PHP
PDF
Continuous integration for androids
PPTX
TDD on OSGi, in practice.
PDF
Continuous Integration with Maven for Android apps
PDF
Monorepo at Pinterest
PDF
vodQA Pune (2019) - Jenkins pipeline As code
PPTX
Webrtc plugins for Desktop Browsers
ODP
Behaviour Driven Development Hands-on
PPTX
A walkthrough of JavaScript ES6 features
PPTX
Typescript kata The TDD style 2 edition
ODP
Test Driven Development (TDD) with Windows PowerShell
Continuous Integration
GraalVM and MicroProfile - A Polyglot Microservices Solution
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
'MICROFRONTENDS WITH REACT' by Liliia Karpenko
What can possibly go wrong if i dont e2 e test my packages?
Microservices in Golang
Using Mountebank to inject behavior into test stubs
Continuous Integration and PHP
Continuous integration & Continuous Delivery @DeVz
Neo4j Graph Database, from PHP
Continuous integration for androids
TDD on OSGi, in practice.
Continuous Integration with Maven for Android apps
Monorepo at Pinterest
vodQA Pune (2019) - Jenkins pipeline As code
Webrtc plugins for Desktop Browsers
Behaviour Driven Development Hands-on
A walkthrough of JavaScript ES6 features
Typescript kata The TDD style 2 edition
Test Driven Development (TDD) with Windows PowerShell
Ad

Similar to 2018 (codeone) type safe approach to invoking restful services with microprofile rest client (20)

PPTX
TechEvent Eclipse Microprofile
PDF
Hybrid Cloud Application Development without vendor lockin
PDF
Implementing Microservices with Jakarta EE and MicroProfile
PDF
Creando microservicios con Java, Microprofile y TomEE - Baranquilla JUG
PPTX
Resful Trinity Code One - San Francisco
PDF
Creando microservicios con Java MicroProfile y TomEE - OGBT
PPTX
Cloud nativeworkshop
PDF
DevNexus 2019: MicroProfile and Jakarta EE - What's Next?
PPTX
Introduction to Eclipse Microprofile
PDF
Creando microservicios con Java y Microprofile - Nicaragua JUG
PPTX
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
PPTX
OpenNTF Webinar 2022-08 - XPages Jakarta EE Support in Practice
PPTX
Cloud native programming model comparison
PPTX
Cloud native programming model comparison
PDF
Building Interoperable Microservices With Eclipse MicroProfile| JakartaOne Li...
PDF
Building RESTful services using SCA and JAX-RS
PPTX
Why jakarta ee matters (ConFoo 2021)
PDF
Jakarta EE and MicroProfile - EclipseCon 2020
PPTX
OpenCloudNative-BeJUG.pptx
PDF
MicroProfile and Jakarta EE - What's Next?
TechEvent Eclipse Microprofile
Hybrid Cloud Application Development without vendor lockin
Implementing Microservices with Jakarta EE and MicroProfile
Creando microservicios con Java, Microprofile y TomEE - Baranquilla JUG
Resful Trinity Code One - San Francisco
Creando microservicios con Java MicroProfile y TomEE - OGBT
Cloud nativeworkshop
DevNexus 2019: MicroProfile and Jakarta EE - What's Next?
Introduction to Eclipse Microprofile
Creando microservicios con Java y Microprofile - Nicaragua JUG
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
OpenNTF Webinar 2022-08 - XPages Jakarta EE Support in Practice
Cloud native programming model comparison
Cloud native programming model comparison
Building Interoperable Microservices With Eclipse MicroProfile| JakartaOne Li...
Building RESTful services using SCA and JAX-RS
Why jakarta ee matters (ConFoo 2021)
Jakarta EE and MicroProfile - EclipseCon 2020
OpenCloudNative-BeJUG.pptx
MicroProfile and Jakarta EE - What's Next?
Ad

More from César Hernández (20)

PDF
7 Recomendaciones para migrar tus aplicaciones a Jakarta EE utilizando Apache...
PDF
Paving the road with Jakarta EE and Apache TomEE - JCON 2021
PDF
7 recomendaciones para migrar tus aplicaciones a Jakarta EE utilizando Apache...
PDF
Keeping brazil's medical industry safe with Micro Profile [TDC 2021]
PDF
Aprende, contribuye, y surfea Cloud Native Java - GuateJUG 2021
PDF
Paving the way with Jakarta EE and Apache TomEE - JCConf
PDF
Keeping brazil's medical industry safe with Micro Profile and JakartaEE - Jak...
PDF
Pavimentando el camino con Jakarta EE 9 y Apache TomEE
PDF
It is easy contributing to open source - JCON 2020
PDF
It is easy contributing to Open Source - ECLIPSE CON 2020
PDF
Paving the way with Jakarta EE and apache TomEE at cloudconferenceday
PDF
Pavimentando el Camino con Jakarta EE 9 y Apache TomEE 9.0.0
PDF
Creando microservicios con java micro profile y tomee - CUNORI 2020
PDF
Paving the way with Jakarta EE and Apache TomEE - itkonekt 2020
PDF
Keeping brazil's medical industry safe with Micro Profile and JakartaEE - Jak...
PDF
Es fácil contribuir al open source - Bolivia JUG 2020
PDF
Its easy! contributing to open source - Devnexus 2020
PDF
Conviértete en un contributor de open source con apache TomEE
PDF
Deconstruyendo la seguridad en rest
PDF
Open jalpa 2019 - CI y CD en la nube
7 Recomendaciones para migrar tus aplicaciones a Jakarta EE utilizando Apache...
Paving the road with Jakarta EE and Apache TomEE - JCON 2021
7 recomendaciones para migrar tus aplicaciones a Jakarta EE utilizando Apache...
Keeping brazil's medical industry safe with Micro Profile [TDC 2021]
Aprende, contribuye, y surfea Cloud Native Java - GuateJUG 2021
Paving the way with Jakarta EE and Apache TomEE - JCConf
Keeping brazil's medical industry safe with Micro Profile and JakartaEE - Jak...
Pavimentando el camino con Jakarta EE 9 y Apache TomEE
It is easy contributing to open source - JCON 2020
It is easy contributing to Open Source - ECLIPSE CON 2020
Paving the way with Jakarta EE and apache TomEE at cloudconferenceday
Pavimentando el Camino con Jakarta EE 9 y Apache TomEE 9.0.0
Creando microservicios con java micro profile y tomee - CUNORI 2020
Paving the way with Jakarta EE and Apache TomEE - itkonekt 2020
Keeping brazil's medical industry safe with Micro Profile and JakartaEE - Jak...
Es fácil contribuir al open source - Bolivia JUG 2020
Its easy! contributing to open source - Devnexus 2020
Conviértete en un contributor de open source con apache TomEE
Deconstruyendo la seguridad en rest
Open jalpa 2019 - CI y CD en la nube

Recently uploaded (20)

PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Review of recent advances in non-invasive hemoglobin estimation
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
Understanding_Digital_Forensics_Presentation.pptx
cuic standard and advanced reporting.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Big Data Technologies - Introduction.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Mobile App Security Testing_ A Comprehensive Guide.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Review of recent advances in non-invasive hemoglobin estimation
The AUB Centre for AI in Media Proposal.docx
MIND Revenue Release Quarter 2 2025 Press Release
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
“AI and Expert System Decision Support & Business Intelligence Systems”
Building Integrated photovoltaic BIPV_UPV.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Approach and Philosophy of On baking technology
Advanced methodologies resolving dimensionality complications for autism neur...

2018 (codeone) type safe approach to invoking restful services with microprofile rest client