SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Tendances (20)

Golang (Go Programming Language)
Golang (Go Programming Language)Golang (Go Programming Language)
Golang (Go Programming Language)
 
Go Programming language, golang
Go Programming language, golangGo Programming language, golang
Go Programming language, golang
 
OWASP Secure Coding Practices - Quick Reference Guide
OWASP Secure Coding Practices - Quick Reference GuideOWASP Secure Coding Practices - Quick Reference Guide
OWASP Secure Coding Practices - Quick Reference Guide
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
Software Craftsmanship
Software CraftsmanshipSoftware Craftsmanship
Software Craftsmanship
 
Git and Github Session
Git and Github SessionGit and Github Session
Git and Github Session
 
GO programming language
GO programming languageGO programming language
GO programming language
 
SonarQube - Should I Stay or Should I Go ?
SonarQube - Should I Stay or Should I Go ? SonarQube - Should I Stay or Should I Go ?
SonarQube - Should I Stay or Should I Go ?
 
Docker
DockerDocker
Docker
 
Go. Why it goes
Go. Why it goesGo. Why it goes
Go. Why it goes
 
El CV y Github: El momento de jugar como pros 2019
El CV y Github: El momento de jugar como pros 2019El CV y Github: El momento de jugar como pros 2019
El CV y Github: El momento de jugar como pros 2019
 
DevOps Introduction
DevOps IntroductionDevOps Introduction
DevOps Introduction
 
Clean Code
Clean CodeClean Code
Clean Code
 
Jira overview
Jira overviewJira overview
Jira overview
 
CI with Gitlab & Docker
CI with Gitlab & DockerCI with Gitlab & Docker
CI with Gitlab & Docker
 
Git & GitHub for Beginners
Git & GitHub for BeginnersGit & GitHub for Beginners
Git & GitHub for Beginners
 
Golang Vs Rust
Golang Vs Rust Golang Vs Rust
Golang Vs Rust
 
Gitlab ci-cd
Gitlab ci-cdGitlab ci-cd
Gitlab ci-cd
 
Golang getting started
Golang getting startedGolang getting started
Golang getting started
 
Agile
AgileAgile
Agile
 

Similaire à 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 2020 - Have your cake and eat it too: GraphQL? REST? W...
apidays LIVE Australia 2020 - Have your cake and eat it too: GraphQL? REST? W...apidays LIVE Australia 2020 - Have your cake and eat it too: GraphQL? REST? W...
apidays LIVE Australia 2020 - Have your cake and eat it too: GraphQL? REST? W...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
 

Similaire à 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 2020 - Have your cake and eat it too: GraphQL? REST? W...
apidays LIVE Australia 2020 - Have your cake and eat it too: GraphQL? REST? W...apidays LIVE Australia 2020 - Have your cake and eat it too: GraphQL? REST? W...
apidays LIVE Australia 2020 - Have your cake and eat it too: GraphQL? REST? W...
 
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
 

Dernier

%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 

Dernier (20)

%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 

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