SlideShare a Scribd company logo
1 of 35
Download to read offline
Consumer Driven Contracts
and Your Microservice
Architecture
Marcin Grzejszczak, Pivotal
@mgrzejszczak
Spring Cloud developer at Spring Cloud (Pivotal)
Working mostly on Spring Cloud Sleuth
and Spring Cloud Contract
Automation freak
About me
Twitter: @mgrzejszczak
Blog: http://toomuchcoding.com
Introduction
Demo
Summary
Agenda
● Producer
○ service that exposes an API
● Consumer
○ service that consumes the API of the producer
● Contract
○ agreement between producer and consumer how the API will look like
● Consumer Driven Contracts
○ approach where the consumer drives the changes of the API of the producer
Introduction
● Stub validity & reusability in the integration tests
● Nice API creation
Introduction
What problems are we trying to solve?
Introduction
Typical situation
HTTP
CONSUMER PRODUCER
Introduction
How to write a test for it?
HTTP
CONSUMER PRODUCER
Introduction
Stub validity & reusability
WE’RE ON THE CONSUMER SIDE!!
CONSUMER OWNS THE STUB
DEFINITIONS
Introduction
Stub validity & reusability
Introduction
Stub validity & reusability
10
Introduction
Stub validity & reusability
11
Introduction
Stub validity & reusability
12
Introduction
Stub validity & reusability
13
● My tests fail cause I’m shooting a request at a non existant URL
● I rewrote all my code to work with the new URL
● The unit and integration tests pass
● Now we deploy to an environment
where real integrations will take place...
Introduction
So now what?
Introduction
Ooops...
Stubs that were used in the build phase have nothing to do with the real API!!
Introduction
What went wrong?
HTTP
CONSUMER PRODUCER
TEST
OK
HTTP
CONSUMER PRODUCER
REALITY
WAT?!
● Stubs reside with the consumer
● Consumer controls the stubbing process
● How are you sure that the stubs are valid?
● What if other teams want to reuse those stubs?
Introduction
Stub validity & reusability
● It’s the consumer that uses the API
● Consumers should take part in the creation of the API of the producer
● The producer’s API change should be driven by consumers
Introduction
Nice API creation
Introduction
Nice API creation - no cooperation results
Introduction
Nice API creation - no cooperation results
Demo
Potential answer
Spring Cloud Contract
● Consumer
○ service that gets beer requests
○ has to ask another service if the client can get the beer
● Producer
○ service that checks if the client is old enough to buy beer
● Feature
○ if the user is too young - the beer will not be sold
○ otherwise the beer will be granted
Demo
What are we going to code?
Introduction
What are we going to code?
I’m 22 give me a beer
CONSUMER PRODUCER
There you go!
Can he get the beer?
Yes!
Introduction
What are we going to code?
I’m 17 give me a beer
CONSUMER PRODUCER
Get lost!
Can he get the beer?
No!
Introduction
What are we going to code?
BLACK TERMINAL
BLACK IDE
CONSUMER
WHITE TERMINAL
WHITE IDE
PRODUCER
Demo
DEMO
Summary
Consumer’s offline
work
Consumer Phase 1 Consumer Phase 2
Consumer’s switching
to online
Producer phase
Producer’s
implementing the
feature
Summary
Consumer flow 1
• starts TDD - writes the test for the feature
• clones producer code to change the API locally
• in the cloned producer code converts contracts into stubs and installs
them locally
• in the consumer code turns Stub Runner to offline mode
• configures Stub Runner to download stubs of the producer
• red - green - refactor on the API and tests
• repeats the process until the tests are green and API acceptable
• files a PR to the producer with the contract proposal
Summary
Producer flow
• takes over the PR
• writes the missing implementation that will make the autogenerated tests pass
• merges PR and deploys the JARs with the app and the stubs
Summary
Consumer flow 2
• switches off the Stub Runner’s offline mode once the producer uploads the
stubs
• configure Stub Runner by providing the URL to a repo with stubs
• will have its test broken if the producer makes any breaking changes of the API
With Spring Cloud Contract and Consumer Driven Contracts:
● we’ve created an API that suits the consumer and the producer
● expectations were defined by readable contracts
● expectations were tested against the producer
● producer stubs can be reused by consumers
● starting and setting stubs is fully automated
Summary
Why use Spring Cloud Contract Verifier?
● Possibility to do CDC with messaging
● Clear and easy to use, statically typed DSL
● Automatic generation of tests from the defined Contract
● Stub Runner functionality - the stubs are automatically downloaded at runtime from
Nexus / Artifactory
● Spring Cloud integration - no discovery service is needed for integration tests
● Integration with Cloud Foundry - Stub Runner Boot
● Possibility to keep all contracts in a single repo
Summary
Demo
Spring Cloud Contract repo
Spring Cloud Contract documentation
Spring Cloud Contract Gitter
Producer sample
Client sample
LINKS
Thank you!
Marcin Grzejszczak
Pivotal
mgrzejszczak@pivotal.io
mgrzejszczak

More Related Content

What's hot

Agile Technology Delivery Process Mr
Agile Technology Delivery Process   MrAgile Technology Delivery Process   Mr
Agile Technology Delivery Process MrMurray Robinson
 
API Management Within a Microservices Architecture
API Management Within a Microservices Architecture API Management Within a Microservices Architecture
API Management Within a Microservices Architecture Nadeesha Gamage
 
GraphQL vs BFF: A critical perspective
GraphQL vs BFF: A critical perspectiveGraphQL vs BFF: A critical perspective
GraphQL vs BFF: A critical perspectivePronovix
 
Building a Successful Service Culture: How Airbnb Elevates with JIRA Service ...
Building a Successful Service Culture: How Airbnb Elevates with JIRA Service ...Building a Successful Service Culture: How Airbnb Elevates with JIRA Service ...
Building a Successful Service Culture: How Airbnb Elevates with JIRA Service ...Atlassian
 
APIs Are Forever - How to Design Long-Lasting APIs
APIs Are Forever - How to Design Long-Lasting APIsAPIs Are Forever - How to Design Long-Lasting APIs
APIs Are Forever - How to Design Long-Lasting APIsLaunchAny
 
API Strategy Presentation
API Strategy PresentationAPI Strategy Presentation
API Strategy PresentationLawrence Coburn
 
Contract testing and Pact
Contract testing and PactContract testing and Pact
Contract testing and PactSeb Rose
 
Microservices Integration Patterns with Kafka
Microservices Integration Patterns with KafkaMicroservices Integration Patterns with Kafka
Microservices Integration Patterns with KafkaKasun Indrasiri
 
Consumer driven Contract Test
Consumer driven Contract TestConsumer driven Contract Test
Consumer driven Contract TestKnoldus Inc.
 
So…What Do I Make? (Dan Mall)
So…What Do I Make? (Dan Mall)So…What Do I Make? (Dan Mall)
So…What Do I Make? (Dan Mall)Future Insights
 
Scaling Agile with Portfolio for Jira
Scaling Agile with Portfolio for JiraScaling Agile with Portfolio for Jira
Scaling Agile with Portfolio for JiraAtlassian
 
IBM API Connect Deployment `Good Practices - IBM Think 2018
IBM API Connect Deployment `Good Practices - IBM Think 2018IBM API Connect Deployment `Good Practices - IBM Think 2018
IBM API Connect Deployment `Good Practices - IBM Think 2018Chris Phillips
 
API Management within a Microservice Architecture
API Management within a Microservice ArchitectureAPI Management within a Microservice Architecture
API Management within a Microservice ArchitectureWSO2
 
UXPA 2023: Data science and UX: Smarter together
UXPA 2023: Data science and UX: Smarter togetherUXPA 2023: Data science and UX: Smarter together
UXPA 2023: Data science and UX: Smarter togetherUXPA International
 
Product Canvas Step-by-Step
Product Canvas Step-by-StepProduct Canvas Step-by-Step
Product Canvas Step-by-StepGiulio Roggero
 
Get started with GitHub Copilot.pptx
Get started with GitHub Copilot.pptxGet started with GitHub Copilot.pptx
Get started with GitHub Copilot.pptxKhushiPanwar33
 
Api gateway : To be or not to be
Api gateway : To be or not to beApi gateway : To be or not to be
Api gateway : To be or not to beJaewoo Ahn
 
API Management Solution Powerpoint Presentation Slides
API Management Solution Powerpoint Presentation SlidesAPI Management Solution Powerpoint Presentation Slides
API Management Solution Powerpoint Presentation SlidesSlideTeam
 
I asked ChatGPT for SWOT analysis for Amazon (1).pdf
I asked ChatGPT for SWOT analysis for Amazon (1).pdfI asked ChatGPT for SWOT analysis for Amazon (1).pdf
I asked ChatGPT for SWOT analysis for Amazon (1).pdfGamalSaad12
 

What's hot (20)

Agile Technology Delivery Process Mr
Agile Technology Delivery Process   MrAgile Technology Delivery Process   Mr
Agile Technology Delivery Process Mr
 
API Management Within a Microservices Architecture
API Management Within a Microservices Architecture API Management Within a Microservices Architecture
API Management Within a Microservices Architecture
 
GraphQL vs BFF: A critical perspective
GraphQL vs BFF: A critical perspectiveGraphQL vs BFF: A critical perspective
GraphQL vs BFF: A critical perspective
 
Building a Successful Service Culture: How Airbnb Elevates with JIRA Service ...
Building a Successful Service Culture: How Airbnb Elevates with JIRA Service ...Building a Successful Service Culture: How Airbnb Elevates with JIRA Service ...
Building a Successful Service Culture: How Airbnb Elevates with JIRA Service ...
 
APIs Are Forever - How to Design Long-Lasting APIs
APIs Are Forever - How to Design Long-Lasting APIsAPIs Are Forever - How to Design Long-Lasting APIs
APIs Are Forever - How to Design Long-Lasting APIs
 
API Strategy Presentation
API Strategy PresentationAPI Strategy Presentation
API Strategy Presentation
 
Contract testing and Pact
Contract testing and PactContract testing and Pact
Contract testing and Pact
 
Microservices Integration Patterns with Kafka
Microservices Integration Patterns with KafkaMicroservices Integration Patterns with Kafka
Microservices Integration Patterns with Kafka
 
Guide to an API-first Strategy
Guide to an API-first StrategyGuide to an API-first Strategy
Guide to an API-first Strategy
 
Consumer driven Contract Test
Consumer driven Contract TestConsumer driven Contract Test
Consumer driven Contract Test
 
So…What Do I Make? (Dan Mall)
So…What Do I Make? (Dan Mall)So…What Do I Make? (Dan Mall)
So…What Do I Make? (Dan Mall)
 
Scaling Agile with Portfolio for Jira
Scaling Agile with Portfolio for JiraScaling Agile with Portfolio for Jira
Scaling Agile with Portfolio for Jira
 
IBM API Connect Deployment `Good Practices - IBM Think 2018
IBM API Connect Deployment `Good Practices - IBM Think 2018IBM API Connect Deployment `Good Practices - IBM Think 2018
IBM API Connect Deployment `Good Practices - IBM Think 2018
 
API Management within a Microservice Architecture
API Management within a Microservice ArchitectureAPI Management within a Microservice Architecture
API Management within a Microservice Architecture
 
UXPA 2023: Data science and UX: Smarter together
UXPA 2023: Data science and UX: Smarter togetherUXPA 2023: Data science and UX: Smarter together
UXPA 2023: Data science and UX: Smarter together
 
Product Canvas Step-by-Step
Product Canvas Step-by-StepProduct Canvas Step-by-Step
Product Canvas Step-by-Step
 
Get started with GitHub Copilot.pptx
Get started with GitHub Copilot.pptxGet started with GitHub Copilot.pptx
Get started with GitHub Copilot.pptx
 
Api gateway : To be or not to be
Api gateway : To be or not to beApi gateway : To be or not to be
Api gateway : To be or not to be
 
API Management Solution Powerpoint Presentation Slides
API Management Solution Powerpoint Presentation SlidesAPI Management Solution Powerpoint Presentation Slides
API Management Solution Powerpoint Presentation Slides
 
I asked ChatGPT for SWOT analysis for Amazon (1).pdf
I asked ChatGPT for SWOT analysis for Amazon (1).pdfI asked ChatGPT for SWOT analysis for Amazon (1).pdf
I asked ChatGPT for SWOT analysis for Amazon (1).pdf
 

Viewers also liked

Consumer Driven Contracts and Your Microservice Architecture @ Warsaw JUG
Consumer Driven Contracts and Your Microservice Architecture @ Warsaw JUGConsumer Driven Contracts and Your Microservice Architecture @ Warsaw JUG
Consumer Driven Contracts and Your Microservice Architecture @ Warsaw JUGMarcin Grzejszczak
 
Microservices Tracing With Spring Cloud and Zipkin @Szczecin JUG
Microservices Tracing With Spring Cloud and Zipkin @Szczecin JUGMicroservices Tracing With Spring Cloud and Zipkin @Szczecin JUG
Microservices Tracing With Spring Cloud and Zipkin @Szczecin JUGMarcin Grzejszczak
 
Microservices Tracing with Spring Cloud and Zipkin
Microservices Tracing with Spring Cloud and ZipkinMicroservices Tracing with Spring Cloud and Zipkin
Microservices Tracing with Spring Cloud and ZipkinMarcin Grzejszczak
 
Microservices: Consumer Driven Contracts in Practice
Microservices: Consumer Driven Contracts in PracticeMicroservices: Consumer Driven Contracts in Practice
Microservices: Consumer Driven Contracts in PracticeQaiser Mazhar
 
Consumer Driven Contracts (DDD Perth 2016)
Consumer Driven Contracts (DDD Perth 2016)Consumer Driven Contracts (DDD Perth 2016)
Consumer Driven Contracts (DDD Perth 2016)Rob Crowley
 
Microservices Tracing with Spring Cloud and Zipkin (devoxx)
Microservices Tracing with Spring Cloud and Zipkin (devoxx)Microservices Tracing with Spring Cloud and Zipkin (devoxx)
Microservices Tracing with Spring Cloud and Zipkin (devoxx)Marcin Grzejszczak
 
Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureConsumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureMarcin Grzejszczak
 
Microservices Tracing With Spring Cloud and Zipkin @CybercomDEV
Microservices Tracing With Spring Cloud and Zipkin @CybercomDEVMicroservices Tracing With Spring Cloud and Zipkin @CybercomDEV
Microservices Tracing With Spring Cloud and Zipkin @CybercomDEVMarcin Grzejszczak
 
Lightening Talk: Auckland Continuous Delivery Meetup [Sept 2014] - Pact: Cons...
Lightening Talk: Auckland Continuous Delivery Meetup [Sept 2014] - Pact: Cons...Lightening Talk: Auckland Continuous Delivery Meetup [Sept 2014] - Pact: Cons...
Lightening Talk: Auckland Continuous Delivery Meetup [Sept 2014] - Pact: Cons...Peter Sellars
 
Consumer-driven contracts: avoid microservices integration hell! (MuCon Londo...
Consumer-driven contracts: avoid microservices integration hell! (MuCon Londo...Consumer-driven contracts: avoid microservices integration hell! (MuCon Londo...
Consumer-driven contracts: avoid microservices integration hell! (MuCon Londo...Pierre Vincent
 
Principles of Modern Application Architecture
Principles of Modern Application ArchitecturePrinciples of Modern Application Architecture
Principles of Modern Application ArchitectureRajesh RV
 
How to generate a rest application - DevFest Vienna 2016
How to generate a rest application - DevFest Vienna 2016How to generate a rest application - DevFest Vienna 2016
How to generate a rest application - DevFest Vienna 2016johannes_fiala
 
Swagger 2.0: Latest and Greatest
Swagger 2.0: Latest and GreatestSwagger 2.0: Latest and Greatest
Swagger 2.0: Latest and GreatestLaunchAny
 
Microservices - firststatedot.net - 13-oct-15
Microservices - firststatedot.net - 13-oct-15Microservices - firststatedot.net - 13-oct-15
Microservices - firststatedot.net - 13-oct-15Kevin Buckley
 
MicroProfile Devoxx.us
MicroProfile Devoxx.usMicroProfile Devoxx.us
MicroProfile Devoxx.usjclingan
 
Microservice architecture case study
Microservice architecture case studyMicroservice architecture case study
Microservice architecture case studyRudra Tripathy
 
Java EE Microservices
Java EE MicroservicesJava EE Microservices
Java EE Microservicesjclingan
 
Node.jsv0.8からv4.xへのバージョンアップ ~大規模Push通知基盤の運用事例~
Node.jsv0.8からv4.xへのバージョンアップ ~大規模Push通知基盤の運用事例~Node.jsv0.8からv4.xへのバージョンアップ ~大規模Push通知基盤の運用事例~
Node.jsv0.8からv4.xへのバージョンアップ ~大規模Push通知基盤の運用事例~Recruit Technologies
 

Viewers also liked (20)

Consumer Driven Contracts and Your Microservice Architecture @ Warsaw JUG
Consumer Driven Contracts and Your Microservice Architecture @ Warsaw JUGConsumer Driven Contracts and Your Microservice Architecture @ Warsaw JUG
Consumer Driven Contracts and Your Microservice Architecture @ Warsaw JUG
 
Microservices Tracing With Spring Cloud and Zipkin @Szczecin JUG
Microservices Tracing With Spring Cloud and Zipkin @Szczecin JUGMicroservices Tracing With Spring Cloud and Zipkin @Szczecin JUG
Microservices Tracing With Spring Cloud and Zipkin @Szczecin JUG
 
Microservices Tracing with Spring Cloud and Zipkin
Microservices Tracing with Spring Cloud and ZipkinMicroservices Tracing with Spring Cloud and Zipkin
Microservices Tracing with Spring Cloud and Zipkin
 
Microservices: Consumer Driven Contracts in Practice
Microservices: Consumer Driven Contracts in PracticeMicroservices: Consumer Driven Contracts in Practice
Microservices: Consumer Driven Contracts in Practice
 
Consumer Driven Contracts (DDD Perth 2016)
Consumer Driven Contracts (DDD Perth 2016)Consumer Driven Contracts (DDD Perth 2016)
Consumer Driven Contracts (DDD Perth 2016)
 
Microservices Tracing with Spring Cloud and Zipkin (devoxx)
Microservices Tracing with Spring Cloud and Zipkin (devoxx)Microservices Tracing with Spring Cloud and Zipkin (devoxx)
Microservices Tracing with Spring Cloud and Zipkin (devoxx)
 
Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureConsumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice Architecture
 
Microservices Tracing With Spring Cloud and Zipkin @CybercomDEV
Microservices Tracing With Spring Cloud and Zipkin @CybercomDEVMicroservices Tracing With Spring Cloud and Zipkin @CybercomDEV
Microservices Tracing With Spring Cloud and Zipkin @CybercomDEV
 
Lightening Talk: Auckland Continuous Delivery Meetup [Sept 2014] - Pact: Cons...
Lightening Talk: Auckland Continuous Delivery Meetup [Sept 2014] - Pact: Cons...Lightening Talk: Auckland Continuous Delivery Meetup [Sept 2014] - Pact: Cons...
Lightening Talk: Auckland Continuous Delivery Meetup [Sept 2014] - Pact: Cons...
 
Consumer-driven contracts: avoid microservices integration hell! (MuCon Londo...
Consumer-driven contracts: avoid microservices integration hell! (MuCon Londo...Consumer-driven contracts: avoid microservices integration hell! (MuCon Londo...
Consumer-driven contracts: avoid microservices integration hell! (MuCon Londo...
 
Principles of Modern Application Architecture
Principles of Modern Application ArchitecturePrinciples of Modern Application Architecture
Principles of Modern Application Architecture
 
LiveCoding
LiveCodingLiveCoding
LiveCoding
 
How to generate a rest application - DevFest Vienna 2016
How to generate a rest application - DevFest Vienna 2016How to generate a rest application - DevFest Vienna 2016
How to generate a rest application - DevFest Vienna 2016
 
Swagger 2.0: Latest and Greatest
Swagger 2.0: Latest and GreatestSwagger 2.0: Latest and Greatest
Swagger 2.0: Latest and Greatest
 
Microservices - firststatedot.net - 13-oct-15
Microservices - firststatedot.net - 13-oct-15Microservices - firststatedot.net - 13-oct-15
Microservices - firststatedot.net - 13-oct-15
 
MicroProfile Devoxx.us
MicroProfile Devoxx.usMicroProfile Devoxx.us
MicroProfile Devoxx.us
 
Microservice architecture case study
Microservice architecture case studyMicroservice architecture case study
Microservice architecture case study
 
Java EE Microservices
Java EE MicroservicesJava EE Microservices
Java EE Microservices
 
Cloud Security
Cloud Security Cloud Security
Cloud Security
 
Node.jsv0.8からv4.xへのバージョンアップ ~大規模Push通知基盤の運用事例~
Node.jsv0.8からv4.xへのバージョンアップ ~大規模Push通知基盤の運用事例~Node.jsv0.8からv4.xへのバージョンアップ ~大規模Push通知基盤の運用事例~
Node.jsv0.8からv4.xへのバージョンアップ ~大規模Push通知基盤の運用事例~
 

Similar to Spring Cloud Contract And Your Microservice Architecture

Consumer Driven Contracts like TDD to the API - Olga Maciaszek-Sharma & Marci...
Consumer Driven Contracts like TDD to the API - Olga Maciaszek-Sharma & Marci...Consumer Driven Contracts like TDD to the API - Olga Maciaszek-Sharma & Marci...
Consumer Driven Contracts like TDD to the API - Olga Maciaszek-Sharma & Marci...VMware Tanzu
 
Collaborative Contract Driven Development
Collaborative Contract Driven DevelopmentCollaborative Contract Driven Development
Collaborative Contract Driven DevelopmentBilly Korando
 
[WSO2 Integration Summit Bern 2019] Transforming Your Business through APIs
[WSO2 Integration Summit Bern 2019] Transforming Your Business through APIs[WSO2 Integration Summit Bern 2019] Transforming Your Business through APIs
[WSO2 Integration Summit Bern 2019] Transforming Your Business through APIsWSO2
 
Api management best practices with wso2 api manager
Api management best practices with wso2 api managerApi management best practices with wso2 api manager
Api management best practices with wso2 api managerChanaka Fernando
 
Continuous Delivery at Snyk
Continuous Delivery at SnykContinuous Delivery at Snyk
Continuous Delivery at SnykAnton Drukh
 
TDD for Microservices
TDD for MicroservicesTDD for Microservices
TDD for MicroservicesVMware Tanzu
 
Coordinating Micro-Services with Spring Cloud Contract
Coordinating Micro-Services with Spring Cloud ContractCoordinating Micro-Services with Spring Cloud Contract
Coordinating Micro-Services with Spring Cloud ContractOmri Spector
 
5 Pillars of Building Enterprise0grade APIs
5 Pillars of Building Enterprise0grade APIs5 Pillars of Building Enterprise0grade APIs
5 Pillars of Building Enterprise0grade APIsWSO2
 
API Kompatibilität durch Consumer-Driven Contracts und CI/CD
API Kompatibilität durch Consumer-Driven Contracts und CI/CDAPI Kompatibilität durch Consumer-Driven Contracts und CI/CD
API Kompatibilität durch Consumer-Driven Contracts und CI/CDOPEN KNOWLEDGE GmbH
 
[apidays Live Australia] Leveraging Async APIs to deliver Cross Domain Agile ...
[apidays Live Australia] Leveraging Async APIs to deliver Cross Domain Agile ...[apidays Live Australia] Leveraging Async APIs to deliver Cross Domain Agile ...
[apidays Live Australia] Leveraging Async APIs to deliver Cross Domain Agile ...WSO2
 
Leveraging Async APIs to deliver cross domain agile collaboration
Leveraging Async APIs to deliver cross domain agile collaboration Leveraging Async APIs to deliver cross domain agile collaboration
Leveraging Async APIs to deliver cross domain agile collaboration Nuwan Dias
 
How can Enterprises benefit from GitOps.pdf
How can  Enterprises benefit from GitOps.pdfHow can  Enterprises benefit from GitOps.pdf
How can Enterprises benefit from GitOps.pdfOpsTree solutions
 
Why You Should Be Doing Contract-First API Development
Why You Should Be Doing Contract-First API DevelopmentWhy You Should Be Doing Contract-First API Development
Why You Should Be Doing Contract-First API DevelopmentDevenPhillips
 
Consumer-Driven Contract Testing With Postman
Consumer-Driven Contract Testing With PostmanConsumer-Driven Contract Testing With Postman
Consumer-Driven Contract Testing With PostmanPostman
 
INTERFACE, by apidays - How to Win Friends and Influence People with API First
INTERFACE, by apidays - How to Win Friends and Influence People with API FirstINTERFACE, by apidays - How to Win Friends and Influence People with API First
INTERFACE, by apidays - How to Win Friends and Influence People with API Firstapidays
 
Building an API Factory: Turn your APIs into Products
Building an API Factory: Turn your APIs into ProductsBuilding an API Factory: Turn your APIs into Products
Building an API Factory: Turn your APIs into ProductsNuwan Dias
 
London-MuleSoft-Meetup-April-19-2023
London-MuleSoft-Meetup-April-19-2023London-MuleSoft-Meetup-April-19-2023
London-MuleSoft-Meetup-April-19-2023AnuragSharma900
 
How_to_create_modular_microservice_test_projects.pdf
How_to_create_modular_microservice_test_projects.pdfHow_to_create_modular_microservice_test_projects.pdf
How_to_create_modular_microservice_test_projects.pdfskimorod
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileC4Media
 

Similar to Spring Cloud Contract And Your Microservice Architecture (20)

Consumer Driven Contracts like TDD to the API - Olga Maciaszek-Sharma & Marci...
Consumer Driven Contracts like TDD to the API - Olga Maciaszek-Sharma & Marci...Consumer Driven Contracts like TDD to the API - Olga Maciaszek-Sharma & Marci...
Consumer Driven Contracts like TDD to the API - Olga Maciaszek-Sharma & Marci...
 
Collaborative Contract Driven Development
Collaborative Contract Driven DevelopmentCollaborative Contract Driven Development
Collaborative Contract Driven Development
 
[WSO2 Integration Summit Bern 2019] Transforming Your Business through APIs
[WSO2 Integration Summit Bern 2019] Transforming Your Business through APIs[WSO2 Integration Summit Bern 2019] Transforming Your Business through APIs
[WSO2 Integration Summit Bern 2019] Transforming Your Business through APIs
 
Api management best practices with wso2 api manager
Api management best practices with wso2 api managerApi management best practices with wso2 api manager
Api management best practices with wso2 api manager
 
Continuous Delivery at Snyk
Continuous Delivery at SnykContinuous Delivery at Snyk
Continuous Delivery at Snyk
 
TDD for Microservices
TDD for MicroservicesTDD for Microservices
TDD for Microservices
 
Coordinating Micro-Services with Spring Cloud Contract
Coordinating Micro-Services with Spring Cloud ContractCoordinating Micro-Services with Spring Cloud Contract
Coordinating Micro-Services with Spring Cloud Contract
 
Effective API Design
Effective API DesignEffective API Design
Effective API Design
 
5 Pillars of Building Enterprise0grade APIs
5 Pillars of Building Enterprise0grade APIs5 Pillars of Building Enterprise0grade APIs
5 Pillars of Building Enterprise0grade APIs
 
API Kompatibilität durch Consumer-Driven Contracts und CI/CD
API Kompatibilität durch Consumer-Driven Contracts und CI/CDAPI Kompatibilität durch Consumer-Driven Contracts und CI/CD
API Kompatibilität durch Consumer-Driven Contracts und CI/CD
 
[apidays Live Australia] Leveraging Async APIs to deliver Cross Domain Agile ...
[apidays Live Australia] Leveraging Async APIs to deliver Cross Domain Agile ...[apidays Live Australia] Leveraging Async APIs to deliver Cross Domain Agile ...
[apidays Live Australia] Leveraging Async APIs to deliver Cross Domain Agile ...
 
Leveraging Async APIs to deliver cross domain agile collaboration
Leveraging Async APIs to deliver cross domain agile collaboration Leveraging Async APIs to deliver cross domain agile collaboration
Leveraging Async APIs to deliver cross domain agile collaboration
 
How can Enterprises benefit from GitOps.pdf
How can  Enterprises benefit from GitOps.pdfHow can  Enterprises benefit from GitOps.pdf
How can Enterprises benefit from GitOps.pdf
 
Why You Should Be Doing Contract-First API Development
Why You Should Be Doing Contract-First API DevelopmentWhy You Should Be Doing Contract-First API Development
Why You Should Be Doing Contract-First API Development
 
Consumer-Driven Contract Testing With Postman
Consumer-Driven Contract Testing With PostmanConsumer-Driven Contract Testing With Postman
Consumer-Driven Contract Testing With Postman
 
INTERFACE, by apidays - How to Win Friends and Influence People with API First
INTERFACE, by apidays - How to Win Friends and Influence People with API FirstINTERFACE, by apidays - How to Win Friends and Influence People with API First
INTERFACE, by apidays - How to Win Friends and Influence People with API First
 
Building an API Factory: Turn your APIs into Products
Building an API Factory: Turn your APIs into ProductsBuilding an API Factory: Turn your APIs into Products
Building an API Factory: Turn your APIs into Products
 
London-MuleSoft-Meetup-April-19-2023
London-MuleSoft-Meetup-April-19-2023London-MuleSoft-Meetup-April-19-2023
London-MuleSoft-Meetup-April-19-2023
 
How_to_create_modular_microservice_test_projects.pdf
How_to_create_modular_microservice_test_projects.pdfHow_to_create_modular_microservice_test_projects.pdf
How_to_create_modular_microservice_test_projects.pdf
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy Mobile
 

More from Marcin Grzejszczak

Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureConsumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureMarcin Grzejszczak
 
Continuous Deployment of your Application @jSession#5
Continuous Deployment of your Application @jSession#5Continuous Deployment of your Application @jSession#5
Continuous Deployment of your Application @jSession#5Marcin Grzejszczak
 
Continuous Deployment of your Application @JUGtoberfest
Continuous Deployment of your Application @JUGtoberfestContinuous Deployment of your Application @JUGtoberfest
Continuous Deployment of your Application @JUGtoberfestMarcin Grzejszczak
 
Continuous Deployment To The Cloud @DevoxxPL 2017
Continuous Deployment To The Cloud @DevoxxPL 2017 Continuous Deployment To The Cloud @DevoxxPL 2017
Continuous Deployment To The Cloud @DevoxxPL 2017 Marcin Grzejszczak
 
Continuous Deployment To The Cloud
Continuous Deployment To The CloudContinuous Deployment To The Cloud
Continuous Deployment To The CloudMarcin Grzejszczak
 
Consumer Driven Contracts To Enable API Evolution @Geecon
Consumer Driven Contracts To Enable API Evolution @GeeconConsumer Driven Contracts To Enable API Evolution @Geecon
Consumer Driven Contracts To Enable API Evolution @GeeconMarcin Grzejszczak
 
Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...
Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...
Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...Marcin Grzejszczak
 
Microservices - enough with theory, let's do some code @Geecon Prague 2015
Microservices - enough with theory, let's do some code @Geecon Prague 2015Microservices - enough with theory, let's do some code @Geecon Prague 2015
Microservices - enough with theory, let's do some code @Geecon Prague 2015Marcin Grzejszczak
 
Stick to the rules - Consumer Driven Contracts. 2015.07 Confitura
Stick to the rules - Consumer Driven Contracts. 2015.07 ConfituraStick to the rules - Consumer Driven Contracts. 2015.07 Confitura
Stick to the rules - Consumer Driven Contracts. 2015.07 ConfituraMarcin Grzejszczak
 
Do you think you're doing microservice architecture? What about infrastructur...
Do you think you're doing microservice architecture? What about infrastructur...Do you think you're doing microservice architecture? What about infrastructur...
Do you think you're doing microservice architecture? What about infrastructur...Marcin Grzejszczak
 
Introduction to Groovy runtime metaprogramming and AST transforms
Introduction to Groovy runtime metaprogramming and AST transformsIntroduction to Groovy runtime metaprogramming and AST transforms
Introduction to Groovy runtime metaprogramming and AST transformsMarcin Grzejszczak
 

More from Marcin Grzejszczak (12)

Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureConsumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice Architecture
 
Continuous Deployment of your Application @jSession#5
Continuous Deployment of your Application @jSession#5Continuous Deployment of your Application @jSession#5
Continuous Deployment of your Application @jSession#5
 
Continuous Deployment of your Application @JUGtoberfest
Continuous Deployment of your Application @JUGtoberfestContinuous Deployment of your Application @JUGtoberfest
Continuous Deployment of your Application @JUGtoberfest
 
Continuous Deployment To The Cloud @DevoxxPL 2017
Continuous Deployment To The Cloud @DevoxxPL 2017 Continuous Deployment To The Cloud @DevoxxPL 2017
Continuous Deployment To The Cloud @DevoxxPL 2017
 
Continuous Deployment To The Cloud
Continuous Deployment To The CloudContinuous Deployment To The Cloud
Continuous Deployment To The Cloud
 
Consumer Driven Contracts To Enable API Evolution @Geecon
Consumer Driven Contracts To Enable API Evolution @GeeconConsumer Driven Contracts To Enable API Evolution @Geecon
Consumer Driven Contracts To Enable API Evolution @Geecon
 
Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...
Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...
Continuous Deployment To The Cloud With Spring Cloud Pipelines @WarsawCloudNa...
 
Spring Cloud’s Groovy
Spring Cloud’s GroovySpring Cloud’s Groovy
Spring Cloud’s Groovy
 
Microservices - enough with theory, let's do some code @Geecon Prague 2015
Microservices - enough with theory, let's do some code @Geecon Prague 2015Microservices - enough with theory, let's do some code @Geecon Prague 2015
Microservices - enough with theory, let's do some code @Geecon Prague 2015
 
Stick to the rules - Consumer Driven Contracts. 2015.07 Confitura
Stick to the rules - Consumer Driven Contracts. 2015.07 ConfituraStick to the rules - Consumer Driven Contracts. 2015.07 Confitura
Stick to the rules - Consumer Driven Contracts. 2015.07 Confitura
 
Do you think you're doing microservice architecture? What about infrastructur...
Do you think you're doing microservice architecture? What about infrastructur...Do you think you're doing microservice architecture? What about infrastructur...
Do you think you're doing microservice architecture? What about infrastructur...
 
Introduction to Groovy runtime metaprogramming and AST transforms
Introduction to Groovy runtime metaprogramming and AST transformsIntroduction to Groovy runtime metaprogramming and AST transforms
Introduction to Groovy runtime metaprogramming and AST transforms
 

Recently uploaded

Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 

Recently uploaded (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 

Spring Cloud Contract And Your Microservice Architecture

  • 1. Consumer Driven Contracts and Your Microservice Architecture Marcin Grzejszczak, Pivotal @mgrzejszczak
  • 2. Spring Cloud developer at Spring Cloud (Pivotal) Working mostly on Spring Cloud Sleuth and Spring Cloud Contract Automation freak About me Twitter: @mgrzejszczak Blog: http://toomuchcoding.com
  • 4. ● Producer ○ service that exposes an API ● Consumer ○ service that consumes the API of the producer ● Contract ○ agreement between producer and consumer how the API will look like ● Consumer Driven Contracts ○ approach where the consumer drives the changes of the API of the producer Introduction
  • 5. ● Stub validity & reusability in the integration tests ● Nice API creation Introduction What problems are we trying to solve?
  • 7. Introduction How to write a test for it? HTTP CONSUMER PRODUCER
  • 8. Introduction Stub validity & reusability WE’RE ON THE CONSUMER SIDE!! CONSUMER OWNS THE STUB DEFINITIONS
  • 14. ● My tests fail cause I’m shooting a request at a non existant URL ● I rewrote all my code to work with the new URL ● The unit and integration tests pass ● Now we deploy to an environment where real integrations will take place... Introduction So now what?
  • 16. Stubs that were used in the build phase have nothing to do with the real API!! Introduction What went wrong? HTTP CONSUMER PRODUCER TEST OK HTTP CONSUMER PRODUCER REALITY WAT?!
  • 17. ● Stubs reside with the consumer ● Consumer controls the stubbing process ● How are you sure that the stubs are valid? ● What if other teams want to reuse those stubs? Introduction Stub validity & reusability
  • 18. ● It’s the consumer that uses the API ● Consumers should take part in the creation of the API of the producer ● The producer’s API change should be driven by consumers Introduction Nice API creation
  • 19. Introduction Nice API creation - no cooperation results
  • 20. Introduction Nice API creation - no cooperation results
  • 22. ● Consumer ○ service that gets beer requests ○ has to ask another service if the client can get the beer ● Producer ○ service that checks if the client is old enough to buy beer ● Feature ○ if the user is too young - the beer will not be sold ○ otherwise the beer will be granted Demo What are we going to code?
  • 23. Introduction What are we going to code? I’m 22 give me a beer CONSUMER PRODUCER There you go! Can he get the beer? Yes!
  • 24. Introduction What are we going to code? I’m 17 give me a beer CONSUMER PRODUCER Get lost! Can he get the beer? No!
  • 25. Introduction What are we going to code? BLACK TERMINAL BLACK IDE CONSUMER WHITE TERMINAL WHITE IDE PRODUCER
  • 27. Summary Consumer’s offline work Consumer Phase 1 Consumer Phase 2 Consumer’s switching to online Producer phase Producer’s implementing the feature
  • 28. Summary Consumer flow 1 • starts TDD - writes the test for the feature • clones producer code to change the API locally • in the cloned producer code converts contracts into stubs and installs them locally • in the consumer code turns Stub Runner to offline mode • configures Stub Runner to download stubs of the producer • red - green - refactor on the API and tests • repeats the process until the tests are green and API acceptable • files a PR to the producer with the contract proposal
  • 29. Summary Producer flow • takes over the PR • writes the missing implementation that will make the autogenerated tests pass • merges PR and deploys the JARs with the app and the stubs
  • 30. Summary Consumer flow 2 • switches off the Stub Runner’s offline mode once the producer uploads the stubs • configure Stub Runner by providing the URL to a repo with stubs • will have its test broken if the producer makes any breaking changes of the API
  • 31. With Spring Cloud Contract and Consumer Driven Contracts: ● we’ve created an API that suits the consumer and the producer ● expectations were defined by readable contracts ● expectations were tested against the producer ● producer stubs can be reused by consumers ● starting and setting stubs is fully automated Summary
  • 32. Why use Spring Cloud Contract Verifier? ● Possibility to do CDC with messaging ● Clear and easy to use, statically typed DSL ● Automatic generation of tests from the defined Contract ● Stub Runner functionality - the stubs are automatically downloaded at runtime from Nexus / Artifactory ● Spring Cloud integration - no discovery service is needed for integration tests ● Integration with Cloud Foundry - Stub Runner Boot ● Possibility to keep all contracts in a single repo Summary
  • 33. Demo
  • 34. Spring Cloud Contract repo Spring Cloud Contract documentation Spring Cloud Contract Gitter Producer sample Client sample LINKS