SlideShare a Scribd company logo
1 of 23
Download to read offline
https://jhipster.tech @java_hipster
Connect your JHipster apps to the
world of APIs with OpenAPI and gRPC
+ +
https://jhipster.tech @java_hipster
Le me
● Working at Engie (but soon CDiscount)
● JHipster core team member
● Swagger-codegen former core team
member
● OpenAPI-generator core team member @cbornet_
https://jhipster.tech @java_hipster
Evolution of SOA protocols
RMI
CORBA
DCOM SOAP
REST
gRPC ?
AVRO
THRIFT
XML-RPC GraphQL ?
https://jhipster.tech @java_hipster
Today, everybody does REST...
https://jhipster.tech @java_hipster
Today, everybody does REST…
Richardson maturity model
https://jhipster.tech @java_hipster
Today, everybody does REST…
Roy Fielding : HATEOAS*
is a pre-condition to REST
*HATEOAS: Hypermedia As The Engine Of Application State
https://jhipster.tech @java_hipster
Today, everybody does REST… or not
In practice, this is the state
of the art, including
JHipster
“I am getting frustrated by the number of people calling any HTTP-based
interface a REST API.” - Roy Fielding
https://jhipster.tech @java_hipster
Why Swagger/OpenAPI ?
https://jhipster.tech @java_hipster
Why Swagger/OpenAPI ?
CORBA-IDL
module BankDemo
{
typedef float CashAmount;
typedef string AccountId;
interface Account
{
readonly attribute AccountId account_id;
readonly attribute CashAmount balance;
void withdraw(in CashAmount amount) raises (InsufficientFunds);
void deposit(in CashAmount amount);
}
}
https://jhipster.tech @java_hipster
Why Swagger/OpenAPI ?
SOAP’s WSDL
<definitions name = "HelloService"
targetNamespace = "http://www.examples.com/wsdl/HelloService.wsdl"
xmlns = "http://schemas.xmlsoap.org/wsdl/"
xmlns:soap = "http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns = "http://www.examples.com/wsdl/HelloService.wsdl"
xmlns:xsd = "http://www.w3.org/2001/XMLSchema" >
<message name = "SayHelloRequest" >
<part name = "firstName" type = "xsd:string" />
</message>
<message name = "SayHelloResponse" >
<part name = "greeting" type = "xsd:string" />
</message>
<portType name = "Hello_PortType" >
<operation name = "sayHello" >
<input message = "tns:SayHelloRequest" />
<output message = "tns:SayHelloResponse" />
</operation>
</portType>
<binding name = "Hello_Binding" type = "tns:Hello_PortType" >
<soap:binding style = "rpc"
transport = "http://schemas.xmlsoap.org/soap/http" />
<operation name = "sayHello" >
<soap:operation soapAction = "sayHello" />
<input>
<soap:body
encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/"
namespace = "urn:examples:helloservice"
use = "encoded" />
</input>
<output>
<soap:body
encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/"
namespace = "urn:examples:helloservice"
use = "encoded" />
</output>
</operation>
</binding>
<service name = "Hello_Service" >
<documentation> WSDL File for HelloService </documentation>
<port binding = "tns:Hello_Binding" name = "Hello_Port" >
<soap:address
location = "http://www.examples.com/SayHello/" />
</port>
</service>
</definitions>
https://jhipster.tech @java_hipster
Why Swagger/OpenAPI ?
REST
No need for an IDL, with
REST my API is dynamic
and self-describing...
https://jhipster.tech @java_hipster
Why Swagger/OpenAPI ?
REST
But you’re not doing HATEOAS !
...
https://jhipster.tech @java_hipster
Why Swagger/OpenAPI ?
So let’s document our API
with word/pdf/asciidoc/...
https://jhipster.tech @java_hipster
Why Swagger/OpenAPI ?
So let’s document our API
with excel/pdf/asciidoc/...
- Tedious to write
- Hard to find
- Inaccurate, errors, not
up-to-date
- Lots of boilerplate code to
write by hand from reading
the doc
https://jhipster.tech @java_hipster
From code to doc : springfox + swagger-ui
- No additional work
- Doc in sync with the code
- No errors (except in case of
Springfox bug)
- Easy to find
https://jhipster.tech @java_hipster
From doc to client SDK
● OpenAPI-generator (previously swagger-codegen)
○ generate client SDK in 50+ languages/libraries
○ supports Swagger v2.0 and OpenAPI v3.0
○ SDK for Spring-Cloud FeignClient
● Module generator-jhipster-swagger-cli
○ Module that wraps Openapi-generator to generate back-end clients in
JHipster
○ Next step : support React and AngularX front-end client
https://jhipster.tech @java_hipster
API-first development
● Write the OpenAPI spec first then generate server stub
code from it
○ early review feedback from peers and client developers (with PRs)
○ clear separation of WHAT vs. HOW
○ single source of truth
○ infrastructure tooling
● JHipster’s “API-First” option
○ configures the openapi-generator-maven-plugin to generate interfaces at
compile time from the OAI spec
○ supports OAI spec v3.0
https://jhipster.tech @java_hipster
gRPC
“gRPC is a modern open source high performance RPC framework that
can run in any environment. It can efficiently connect services in and
across data centers with pluggable support for load balancing, tracing,
health checking and authentication.”
https://jhipster.tech @java_hipster
gRPC vs HTTP-JSON
● API centered
● Built for performance
● Protobuf
○ binary format
○ strongly typed
● IDL built-in
● Strongly typed
● HTTP/2 by default
● 10+ languages
● Service discovery, load balancing, fault
tolerance, monitoring, tracing integrated
● Resource centered
● Built for simplicity
● JSON
○ text format
○ weakly typed
● IDL optional (OpenAPI)
● Weakly typed
● HTTP/2 optional
● All languages
● Service discovery, load balancing, fault
tolerance, monitoring, tracing with the
good framework (Netflix/Spring Cloud)
https://jhipster.tech @java_hipster
gRPC other nice features
● Bidirectional streaming
● Deadline propagation
● Cancellation propagation
● Async non-blocking / reactive JAVA implementation
● Flow Control (pull type with back-pressure) at the wire level (beware of OOME
!!)
● Reactive-gRPC extension
○ https://github.com/salesforce/reactive-grpc by Salesforce
○ Wraps gRPC’s reactive type into Reactor’s Mono/Flux types
○ Passes the Reactive-Streams TCK
https://jhipster.tech @java_hipster
gRPC in JHipster
● generator-jhipster-grpc module
○ actuator endpoints
○ entities
○ your own grpc services
○ uses reactive-grpc lib
● Next steps
○ integrate with the future JH “reactive” option for end-to-end reactive
services from gRPC client to DB.
○ finish security config
○ production features (service discovery, LB, tracing, …)
○ integration of gRPC-web ?
https://jhipster.tech @java_hipster
Questions ?
https://github.com/cbornet/generator-jhipster-swagger-cli
https://github.com/cbornet/generator-jhipster-grpc
https://github.com/OpenAPITools/openapi-generator
https://github.com/salesforce/reactive-grpc
https://jhipster.tech @java_hipster
More information on JHipster
Main website https://jhipster.tech
GitHub https://github.com/jhipster/generator-jhipster
Twitter https://twitter.com/java_hipster
Stack Overflow https://stackoverflow.com/questions/tagged/jhipster?sort=newest

More Related Content

What's hot

Troubleshooting Switched Mode Power Supplies (Presented at EELive!)
Troubleshooting Switched Mode Power Supplies (Presented at EELive!)Troubleshooting Switched Mode Power Supplies (Presented at EELive!)
Troubleshooting Switched Mode Power Supplies (Presented at EELive!)Rohde & Schwarz North America
 
Software programming and development
Software programming and developmentSoftware programming and development
Software programming and developmentAli Raza
 
Digital Signal Processor evolution over the last 30 years
Digital Signal Processor evolution over the last 30 yearsDigital Signal Processor evolution over the last 30 years
Digital Signal Processor evolution over the last 30 yearsFrancois Charlot
 
What Is DevOps?
What Is DevOps?What Is DevOps?
What Is DevOps?Soumya De
 
Electromagnetic blood flow meter
Electromagnetic blood flow meterElectromagnetic blood flow meter
Electromagnetic blood flow meterYuga Aravind Kumar
 
DevOps principles and practices - accelerate flow
DevOps principles and practices - accelerate flowDevOps principles and practices - accelerate flow
DevOps principles and practices - accelerate flowMurughan Palaniachari
 
Bio Potential and Bio Electrodes
Bio Potential and Bio ElectrodesBio Potential and Bio Electrodes
Bio Potential and Bio ElectrodesBurdwan University
 
Microcontroller based heart rate meter
Microcontroller based heart rate meterMicrocontroller based heart rate meter
Microcontroller based heart rate meterChetana Nair
 
DevOps 101 - an Introduction to DevOps
DevOps 101  - an Introduction to DevOpsDevOps 101  - an Introduction to DevOps
DevOps 101 - an Introduction to DevOpsRed Gate Software
 
Unit 1 sepm software myths
Unit 1 sepm software mythsUnit 1 sepm software myths
Unit 1 sepm software mythsKanchanPatil34
 

What's hot (20)

Troubleshooting Switched Mode Power Supplies (Presented at EELive!)
Troubleshooting Switched Mode Power Supplies (Presented at EELive!)Troubleshooting Switched Mode Power Supplies (Presented at EELive!)
Troubleshooting Switched Mode Power Supplies (Presented at EELive!)
 
Transducer
TransducerTransducer
Transducer
 
Software programming and development
Software programming and developmentSoftware programming and development
Software programming and development
 
Software process
Software processSoftware process
Software process
 
Devops
DevopsDevops
Devops
 
software engineering
software engineeringsoftware engineering
software engineering
 
Ultrasonic sensor
Ultrasonic sensorUltrasonic sensor
Ultrasonic sensor
 
Digital Signal Processor evolution over the last 30 years
Digital Signal Processor evolution over the last 30 yearsDigital Signal Processor evolution over the last 30 years
Digital Signal Processor evolution over the last 30 years
 
What Is DevOps?
What Is DevOps?What Is DevOps?
What Is DevOps?
 
Electromagnetic blood flow meter
Electromagnetic blood flow meterElectromagnetic blood flow meter
Electromagnetic blood flow meter
 
Types of sensors
Types of sensorsTypes of sensors
Types of sensors
 
An introduction to DevOps
An introduction to DevOpsAn introduction to DevOps
An introduction to DevOps
 
DevOps principles and practices - accelerate flow
DevOps principles and practices - accelerate flowDevOps principles and practices - accelerate flow
DevOps principles and practices - accelerate flow
 
Bio Potential and Bio Electrodes
Bio Potential and Bio ElectrodesBio Potential and Bio Electrodes
Bio Potential and Bio Electrodes
 
Microcontroller based heart rate meter
Microcontroller based heart rate meterMicrocontroller based heart rate meter
Microcontroller based heart rate meter
 
DevOps Foundation
DevOps FoundationDevOps Foundation
DevOps Foundation
 
Abusive Language Detection.pptx
Abusive Language Detection.pptxAbusive Language Detection.pptx
Abusive Language Detection.pptx
 
DevOps 101 - an Introduction to DevOps
DevOps 101  - an Introduction to DevOpsDevOps 101  - an Introduction to DevOps
DevOps 101 - an Introduction to DevOps
 
Rtos ss
Rtos ssRtos ss
Rtos ss
 
Unit 1 sepm software myths
Unit 1 sepm software mythsUnit 1 sepm software myths
Unit 1 sepm software myths
 

Similar to JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with OpenAPI and gRPC

Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...François-Guillaume Ribreau
 
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays
 
Implementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPCImplementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPCTim Burks
 
Where is my scalable api?
Where is my scalable api?Where is my scalable api?
Where is my scalable api?Altoros
 
Creando microservicios con Java, Microprofile y TomEE - Baranquilla JUG
Creando microservicios con Java, Microprofile y TomEE - Baranquilla JUGCreando microservicios con Java, Microprofile y TomEE - Baranquilla JUG
Creando microservicios con Java, Microprofile y TomEE - Baranquilla JUGCésar Hernández
 
There is REST and then there is "REST"
There is REST and then there is "REST"There is REST and then there is "REST"
There is REST and then there is "REST"Radovan Semancik
 
The future of server side JavaScript
The future of server side JavaScriptThe future of server side JavaScript
The future of server side JavaScriptOleg Podsechin
 
apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...
apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...
apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...apidays
 
GraalVM and MicroProfile - A Polyglot Microservices Solution
GraalVM and MicroProfile - A Polyglot Microservices SolutionGraalVM and MicroProfile - A Polyglot Microservices Solution
GraalVM and MicroProfile - A Polyglot Microservices SolutionRoberto Cortez
 
Web Services and Android - OSSPAC 2009
Web Services and Android - OSSPAC 2009Web Services and Android - OSSPAC 2009
Web Services and Android - OSSPAC 2009sullis
 
Advanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIAdvanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIRasan Samarasinghe
 
Developing Brilliant and Powerful APIs in Ruby & Python
Developing Brilliant and Powerful APIs in Ruby & PythonDeveloping Brilliant and Powerful APIs in Ruby & Python
Developing Brilliant and Powerful APIs in Ruby & PythonSmartBear
 
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20Phil Wilkins
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersJavan Rasokat
 
Building REST APIs using gRPC and Go
Building REST APIs using gRPC and GoBuilding REST APIs using gRPC and Go
Building REST APIs using gRPC and GoAlvaro Viebrantz
 

Similar to JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with OpenAPI and gRPC (20)

Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
 
Web Dev 21-01-2024.pptx
Web Dev 21-01-2024.pptxWeb Dev 21-01-2024.pptx
Web Dev 21-01-2024.pptx
 
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
 
Implementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPCImplementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPC
 
Where is my scalable api?
Where is my scalable api?Where is my scalable api?
Where is my scalable api?
 
Creando microservicios con Java, Microprofile y TomEE - Baranquilla JUG
Creando microservicios con Java, Microprofile y TomEE - Baranquilla JUGCreando microservicios con Java, Microprofile y TomEE - Baranquilla JUG
Creando microservicios con Java, Microprofile y TomEE - Baranquilla JUG
 
There is REST and then there is "REST"
There is REST and then there is "REST"There is REST and then there is "REST"
There is REST and then there is "REST"
 
The future of server side JavaScript
The future of server side JavaScriptThe future of server side JavaScript
The future of server side JavaScript
 
apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...
apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...
apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...
 
Intro to CakePHP
Intro to CakePHPIntro to CakePHP
Intro to CakePHP
 
Switch to Backend 2023
Switch to Backend 2023Switch to Backend 2023
Switch to Backend 2023
 
GraalVM and MicroProfile - A Polyglot Microservices Solution
GraalVM and MicroProfile - A Polyglot Microservices SolutionGraalVM and MicroProfile - A Polyglot Microservices Solution
GraalVM and MicroProfile - A Polyglot Microservices Solution
 
Where is my scalable API?
Where is my scalable API?Where is my scalable API?
Where is my scalable API?
 
Web Services and Android - OSSPAC 2009
Web Services and Android - OSSPAC 2009Web Services and Android - OSSPAC 2009
Web Services and Android - OSSPAC 2009
 
Advanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIAdvanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST API
 
Developing Brilliant and Powerful APIs in Ruby & Python
Developing Brilliant and Powerful APIs in Ruby & PythonDeveloping Brilliant and Powerful APIs in Ruby & Python
Developing Brilliant and Powerful APIs in Ruby & Python
 
Gohan
GohanGohan
Gohan
 
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
 
Building REST APIs using gRPC and Go
Building REST APIs using gRPC and GoBuilding REST APIs using gRPC and Go
Building REST APIs using gRPC and Go
 

Recently uploaded

Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 

Recently uploaded (20)

Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 

JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with OpenAPI and gRPC

  • 1. https://jhipster.tech @java_hipster Connect your JHipster apps to the world of APIs with OpenAPI and gRPC + +
  • 2. https://jhipster.tech @java_hipster Le me ● Working at Engie (but soon CDiscount) ● JHipster core team member ● Swagger-codegen former core team member ● OpenAPI-generator core team member @cbornet_
  • 3. https://jhipster.tech @java_hipster Evolution of SOA protocols RMI CORBA DCOM SOAP REST gRPC ? AVRO THRIFT XML-RPC GraphQL ?
  • 5. https://jhipster.tech @java_hipster Today, everybody does REST… Richardson maturity model
  • 6. https://jhipster.tech @java_hipster Today, everybody does REST… Roy Fielding : HATEOAS* is a pre-condition to REST *HATEOAS: Hypermedia As The Engine Of Application State
  • 7. https://jhipster.tech @java_hipster Today, everybody does REST… or not In practice, this is the state of the art, including JHipster “I am getting frustrated by the number of people calling any HTTP-based interface a REST API.” - Roy Fielding
  • 9. https://jhipster.tech @java_hipster Why Swagger/OpenAPI ? CORBA-IDL module BankDemo { typedef float CashAmount; typedef string AccountId; interface Account { readonly attribute AccountId account_id; readonly attribute CashAmount balance; void withdraw(in CashAmount amount) raises (InsufficientFunds); void deposit(in CashAmount amount); } }
  • 10. https://jhipster.tech @java_hipster Why Swagger/OpenAPI ? SOAP’s WSDL <definitions name = "HelloService" targetNamespace = "http://www.examples.com/wsdl/HelloService.wsdl" xmlns = "http://schemas.xmlsoap.org/wsdl/" xmlns:soap = "http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns = "http://www.examples.com/wsdl/HelloService.wsdl" xmlns:xsd = "http://www.w3.org/2001/XMLSchema" > <message name = "SayHelloRequest" > <part name = "firstName" type = "xsd:string" /> </message> <message name = "SayHelloResponse" > <part name = "greeting" type = "xsd:string" /> </message> <portType name = "Hello_PortType" > <operation name = "sayHello" > <input message = "tns:SayHelloRequest" /> <output message = "tns:SayHelloResponse" /> </operation> </portType> <binding name = "Hello_Binding" type = "tns:Hello_PortType" > <soap:binding style = "rpc" transport = "http://schemas.xmlsoap.org/soap/http" /> <operation name = "sayHello" > <soap:operation soapAction = "sayHello" /> <input> <soap:body encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/" namespace = "urn:examples:helloservice" use = "encoded" /> </input> <output> <soap:body encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/" namespace = "urn:examples:helloservice" use = "encoded" /> </output> </operation> </binding> <service name = "Hello_Service" > <documentation> WSDL File for HelloService </documentation> <port binding = "tns:Hello_Binding" name = "Hello_Port" > <soap:address location = "http://www.examples.com/SayHello/" /> </port> </service> </definitions>
  • 11. https://jhipster.tech @java_hipster Why Swagger/OpenAPI ? REST No need for an IDL, with REST my API is dynamic and self-describing...
  • 12. https://jhipster.tech @java_hipster Why Swagger/OpenAPI ? REST But you’re not doing HATEOAS ! ...
  • 13. https://jhipster.tech @java_hipster Why Swagger/OpenAPI ? So let’s document our API with word/pdf/asciidoc/...
  • 14. https://jhipster.tech @java_hipster Why Swagger/OpenAPI ? So let’s document our API with excel/pdf/asciidoc/... - Tedious to write - Hard to find - Inaccurate, errors, not up-to-date - Lots of boilerplate code to write by hand from reading the doc
  • 15. https://jhipster.tech @java_hipster From code to doc : springfox + swagger-ui - No additional work - Doc in sync with the code - No errors (except in case of Springfox bug) - Easy to find
  • 16. https://jhipster.tech @java_hipster From doc to client SDK ● OpenAPI-generator (previously swagger-codegen) ○ generate client SDK in 50+ languages/libraries ○ supports Swagger v2.0 and OpenAPI v3.0 ○ SDK for Spring-Cloud FeignClient ● Module generator-jhipster-swagger-cli ○ Module that wraps Openapi-generator to generate back-end clients in JHipster ○ Next step : support React and AngularX front-end client
  • 17. https://jhipster.tech @java_hipster API-first development ● Write the OpenAPI spec first then generate server stub code from it ○ early review feedback from peers and client developers (with PRs) ○ clear separation of WHAT vs. HOW ○ single source of truth ○ infrastructure tooling ● JHipster’s “API-First” option ○ configures the openapi-generator-maven-plugin to generate interfaces at compile time from the OAI spec ○ supports OAI spec v3.0
  • 18. https://jhipster.tech @java_hipster gRPC “gRPC is a modern open source high performance RPC framework that can run in any environment. It can efficiently connect services in and across data centers with pluggable support for load balancing, tracing, health checking and authentication.”
  • 19. https://jhipster.tech @java_hipster gRPC vs HTTP-JSON ● API centered ● Built for performance ● Protobuf ○ binary format ○ strongly typed ● IDL built-in ● Strongly typed ● HTTP/2 by default ● 10+ languages ● Service discovery, load balancing, fault tolerance, monitoring, tracing integrated ● Resource centered ● Built for simplicity ● JSON ○ text format ○ weakly typed ● IDL optional (OpenAPI) ● Weakly typed ● HTTP/2 optional ● All languages ● Service discovery, load balancing, fault tolerance, monitoring, tracing with the good framework (Netflix/Spring Cloud)
  • 20. https://jhipster.tech @java_hipster gRPC other nice features ● Bidirectional streaming ● Deadline propagation ● Cancellation propagation ● Async non-blocking / reactive JAVA implementation ● Flow Control (pull type with back-pressure) at the wire level (beware of OOME !!) ● Reactive-gRPC extension ○ https://github.com/salesforce/reactive-grpc by Salesforce ○ Wraps gRPC’s reactive type into Reactor’s Mono/Flux types ○ Passes the Reactive-Streams TCK
  • 21. https://jhipster.tech @java_hipster gRPC in JHipster ● generator-jhipster-grpc module ○ actuator endpoints ○ entities ○ your own grpc services ○ uses reactive-grpc lib ● Next steps ○ integrate with the future JH “reactive” option for end-to-end reactive services from gRPC client to DB. ○ finish security config ○ production features (service discovery, LB, tracing, …) ○ integration of gRPC-web ?
  • 23. https://jhipster.tech @java_hipster More information on JHipster Main website https://jhipster.tech GitHub https://github.com/jhipster/generator-jhipster Twitter https://twitter.com/java_hipster Stack Overflow https://stackoverflow.com/questions/tagged/jhipster?sort=newest