SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

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
Jorge Ferreiro
 

La actualidad más candente (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
 

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

The future of server side JavaScript
The future of server side JavaScriptThe future of server side JavaScript
The future of server side JavaScript
Oleg Podsechin
 

Similar a 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
 

Último

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Último (20)

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
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...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
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-...
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%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
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 

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