SlideShare a Scribd company logo
1 of 16
Consumer Driven Contracts for
Microservices
By Reshmi Krishna By Vinay Upadhya
@reshmi9k @vinayu
About Us
Reshmi Krishna
● Software Engineer
● Platform Architect, Pivotal Cloud Foundry
● Women In Tech Community Member
Twitter : @reshmi9k
MeetUp : Cloud-Native-New-York
Vinay Upadhya
● Software Engineer
● Platform Architect, Pivotal Cloud Foundry
● Application Architecture Evangelist
Twitter : @vinayu
Agenda
What are Consumer Driven Contracts?
What problems are we trying to solve?
Spring Cloud Contract for microservices
Demo
What are Consumer Driven Contracts?
Internal
Marketing
App
External
Reseller
App
Product
Search
Service
A
P
I
{ catalogid, name,
price,
manufacturer }
{ catalogid,
name, price }
Product Schema
{ catalogid, name, price,
manufacturer,
inStock }
Producer
Contract
Expectation
Consumer
Contract
Consumer Driven
Contract
What are Consumer Driven Contracts ( CDC )
Not a new concept but becoming more prevalent in today’s world of
microservices.
It is a pattern for evolving services and their API’s without breaking
backward or forward compatibility.
CDC driven testing is TDD applied at an architectural level of the project.
What problems are we trying to solve?
1. Provide a framework for consumers to set
expectations with consumer contracts and
drive the producer API.
2. Producer test lifecycle includes validating
consumer contracts.
3. Provide reusable producer stubs for
consumers to use in their integration tests.
4. Minimize E2E integration tests.
Spring Cloud Contract
Spring Cloud Contract provides support for CDC and service schemas in Spring Apps.
Being part of Spring Cloud it can help stub out Spring Cloud components like Eureka, Consul
etc.
Comprised of three main projects :-
Spring Cloud Contract Verifier : Library on server side to test if the server isn’t breaking any
consumer contracts.
Spring Cloud Contract Wiremock : Wrapper around wiremock to help start stubs with
wiremock json stubs.
Spring Cloud Contract Stub Runner : Helper library to pull stubs from maven and run them
What is a contract?
Demo
I want to login Can Reshmi/123 login ?
YES !!!!
OK
Demo
I want to login Can Vinay/321 login ?
No !!!!
NOT_OKAY
Typical CDC Flow
Consumer Phase 1 Producer Phase Consumer Phase 2
Consumer
Offline Work
Producer
Implementing
Feature
Consumer
Online Work
Consumer Flow 1 (Login Client)
Start TDD - writes the test for the feature
Write the missing implementation
Clone the Producer (LoginServerService) repository locally
Define the contract locally in the repo of Producer
Add the Spring Cloud Contract Verifier plugin
Run the integration tests
Producer Flow (Login Server)
Take over the PR
Write the missing implementation that will make the autogenerated tests pass
Merge PR and deploys the JARs with the app and the stubs
Consumer Flow 2 (Login Client)
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
Demo : Add additional parameter to login
Login Validate(UN,PWD,AC)
Response
Response
Resources
Docs : https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html
MeetUp Demo : https://github.com/reshmik/spring-cloud-contract-login-demo.git
Consumer Driven Contracts (MarcinGrzejszczak) : http://www.slideshare.net/MarcinGrzejszczak/consumer-driven-contracts-
and-your-microservice-architecture-67641511
More Samples : https://github.com/spring-cloud/spring-cloud-contract/tree/1.0.x/samples
Talk to the SpringCloudContract Team : https://gitter.im/spring-cloud/spring-cloud-contract

More Related Content

What's hot

Master Continuous Delivery with CloudBees Jenkins Platform
Master Continuous Delivery with CloudBees Jenkins PlatformMaster Continuous Delivery with CloudBees Jenkins Platform
Master Continuous Delivery with CloudBees Jenkins Platform
dcjuengst
 

What's hot (20)

Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
 
ITKonekt 2023: The Busy Platform Engineers Guide to API Gateways
ITKonekt 2023: The Busy Platform Engineers Guide to API GatewaysITKonekt 2023: The Busy Platform Engineers Guide to API Gateways
ITKonekt 2023: The Busy Platform Engineers Guide to API Gateways
 
DevOps without DevOps Tools
DevOps without DevOps ToolsDevOps without DevOps Tools
DevOps without DevOps Tools
 
Devops architecture
Devops architectureDevops architecture
Devops architecture
 
Test Automation - Principles and Practices
Test Automation - Principles and PracticesTest Automation - Principles and Practices
Test Automation - Principles and Practices
 
Master Continuous Delivery with CloudBees Jenkins Platform
Master Continuous Delivery with CloudBees Jenkins PlatformMaster Continuous Delivery with CloudBees Jenkins Platform
Master Continuous Delivery with CloudBees Jenkins Platform
 
Understanding DevOps
Understanding DevOpsUnderstanding DevOps
Understanding DevOps
 
Lean UX
Lean UXLean UX
Lean UX
 
Demystifying DevOps
Demystifying DevOpsDemystifying DevOps
Demystifying DevOps
 
Case Study 3 - Portfolio Project Final - Google UX Design Certificate
Case Study 3 - Portfolio Project Final - Google UX Design CertificateCase Study 3 - Portfolio Project Final - Google UX Design Certificate
Case Study 3 - Portfolio Project Final - Google UX Design Certificate
 
Postman & API Testing by Amber Race
Postman & API Testing by Amber RacePostman & API Testing by Amber Race
Postman & API Testing by Amber Race
 
뱅크샐러드 앱 마케팅 전략 : 퍼포먼스 마케팅 성공 사례
뱅크샐러드 앱 마케팅 전략 : 퍼포먼스 마케팅 성공 사례뱅크샐러드 앱 마케팅 전략 : 퍼포먼스 마케팅 성공 사례
뱅크샐러드 앱 마케팅 전략 : 퍼포먼스 마케팅 성공 사례
 
[물류D.party]마켓컬리
[물류D.party]마켓컬리[물류D.party]마켓컬리
[물류D.party]마켓컬리
 
Component testing with cypress
Component testing with cypressComponent testing with cypress
Component testing with cypress
 
CI/CD
CI/CDCI/CD
CI/CD
 
Test-Driven Development in Vue with Cypress
Test-Driven Development in Vue with CypressTest-Driven Development in Vue with Cypress
Test-Driven Development in Vue with Cypress
 
Integration testing with PACT
Integration testing with PACTIntegration testing with PACT
Integration testing with PACT
 
Api testing
Api testingApi testing
Api testing
 
DevOps Culture
DevOps CultureDevOps Culture
DevOps Culture
 
API Test Automation Tips and Tricks
API Test Automation Tips and TricksAPI Test Automation Tips and Tricks
API Test Automation Tips and Tricks
 

Viewers also liked

台中青商微講堂 2015 雲端工具活用術 by Lala
台中青商微講堂 2015 雲端工具活用術 by Lala台中青商微講堂 2015 雲端工具活用術 by Lala
台中青商微講堂 2015 雲端工具活用術 by Lala
LaLa Mai
 

Viewers also liked (20)

Implementing microservices tracing with spring cloud and zipkin (spring one)
Implementing microservices tracing with spring cloud and zipkin (spring one)Implementing microservices tracing with spring cloud and zipkin (spring one)
Implementing microservices tracing with spring cloud and zipkin (spring one)
 
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: 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 and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureConsumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice Architecture
 
Spring Cloud Contract And Your Microservice Architecture
Spring Cloud Contract And Your Microservice ArchitectureSpring Cloud Contract And Your Microservice Architecture
Spring Cloud Contract And Your Microservice Architecture
 
Consumer-driven contracts: avoid microservices integration hell! (LondonCD - ...
Consumer-driven contracts: avoid microservices integration hell! (LondonCD - ...Consumer-driven contracts: avoid microservices integration hell! (LondonCD - ...
Consumer-driven contracts: avoid microservices integration hell! (LondonCD - ...
 
Lattice: A Cloud-Native Platform for Your Spring Applications
Lattice: A Cloud-Native Platform for Your Spring ApplicationsLattice: A Cloud-Native Platform for Your Spring Applications
Lattice: A Cloud-Native Platform for Your Spring Applications
 
Agile Development with OSGi
Agile Development with OSGiAgile Development with OSGi
Agile Development with OSGi
 
Electrolux Capital Markets Day 2013 - Presentation Keith McLoughlin, CEO
Electrolux Capital Markets Day 2013 - Presentation Keith McLoughlin, CEOElectrolux Capital Markets Day 2013 - Presentation Keith McLoughlin, CEO
Electrolux Capital Markets Day 2013 - Presentation Keith McLoughlin, CEO
 
What is this "docker"
What is this  "docker" What is this  "docker"
What is this "docker"
 
Gradle起步走: 以CLI Application為例 @ JCConf 2014
Gradle起步走: 以CLI Application為例 @ JCConf 2014Gradle起步走: 以CLI Application為例 @ JCConf 2014
Gradle起步走: 以CLI Application為例 @ JCConf 2014
 
Reactive Fault Tolerant Programming with Hystrix and RxJava
Reactive Fault Tolerant Programming with Hystrix and RxJavaReactive Fault Tolerant Programming with Hystrix and RxJava
Reactive Fault Tolerant Programming with Hystrix and RxJava
 
从玩具到生产 - Cloud Foundry 上海峰会2015年
从玩具到生产 - Cloud Foundry 上海峰会2015年从玩具到生产 - Cloud Foundry 上海峰会2015年
从玩具到生产 - Cloud Foundry 上海峰会2015年
 
Emirates
EmiratesEmirates
Emirates
 
Establish The Core of Cloud Computing Application by Using Hazelcast (Chinese)
Establish The Core of  Cloud Computing Application  by Using Hazelcast (Chinese)Establish The Core of  Cloud Computing Application  by Using Hazelcast (Chinese)
Establish The Core of Cloud Computing Application by Using Hazelcast (Chinese)
 
台中青商微講堂 2015 雲端工具活用術 by Lala
台中青商微講堂 2015 雲端工具活用術 by Lala台中青商微講堂 2015 雲端工具活用術 by Lala
台中青商微講堂 2015 雲端工具活用術 by Lala
 
Honey's Data Dinner#13 跨領域專案開發經驗談(User Story Mapping)
Honey's Data Dinner#13 跨領域專案開發經驗談(User Story Mapping)Honey's Data Dinner#13 跨領域專案開發經驗談(User Story Mapping)
Honey's Data Dinner#13 跨領域專案開發經驗談(User Story Mapping)
 
我的敏捷测试宣言(Agile Testing Manifesto)
我的敏捷测试宣言(Agile Testing Manifesto)我的敏捷测试宣言(Agile Testing Manifesto)
我的敏捷测试宣言(Agile Testing Manifesto)
 
Consumer Driven Contracts (DDD Perth 2016)
Consumer Driven Contracts (DDD Perth 2016)Consumer Driven Contracts (DDD Perth 2016)
Consumer Driven Contracts (DDD Perth 2016)
 
SSH & the City. From measuring societal impact to mapping social engagement
SSH & the City. From measuring societal impact to mapping social engagementSSH & the City. From measuring societal impact to mapping social engagement
SSH & the City. From measuring societal impact to mapping social engagement
 

Similar to Consumer Driven Contracts for microservices

Cloud-Native Fundamentals: Accelerating Development with Continuous Integration
Cloud-Native Fundamentals: Accelerating Development with Continuous IntegrationCloud-Native Fundamentals: Accelerating Development with Continuous Integration
Cloud-Native Fundamentals: Accelerating Development with Continuous Integration
VMware Tanzu
 
Four Steps Toward a Safer Continuous Delivery Practice (Hint: Add Monitoring)
Four Steps Toward a Safer Continuous Delivery Practice (Hint: Add Monitoring)Four Steps Toward a Safer Continuous Delivery Practice (Hint: Add Monitoring)
Four Steps Toward a Safer Continuous Delivery Practice (Hint: Add Monitoring)
VMware Tanzu
 

Similar to Consumer Driven Contracts for microservices (20)

TDD for Microservices
TDD for MicroservicesTDD for Microservices
TDD for Microservices
 
Transform Digital Business with DevOps
Transform Digital Business with DevOpsTransform Digital Business with DevOps
Transform Digital Business with DevOps
 
Consumer driven contracts in java world
Consumer driven contracts in java worldConsumer driven contracts in java world
Consumer driven contracts in java world
 
Continuous delivery with Spring Cloud Pipelines Case Study
Continuous delivery with Spring Cloud Pipelines Case StudyContinuous delivery with Spring Cloud Pipelines Case Study
Continuous delivery with Spring Cloud Pipelines Case Study
 
Continuous Delivery with Spring Cloud Pipelines: Case study. - Lublin JUG
Continuous Delivery with Spring Cloud Pipelines: Case study. - Lublin JUGContinuous Delivery with Spring Cloud Pipelines: Case study. - Lublin JUG
Continuous Delivery with Spring Cloud Pipelines: Case study. - Lublin JUG
 
DevOps: Age Of CI/CD
DevOps: Age Of CI/CDDevOps: Age Of CI/CD
DevOps: Age Of CI/CD
 
RTP Bluemix Meetup April 20th 2016
RTP Bluemix Meetup April 20th 2016RTP Bluemix Meetup April 20th 2016
RTP Bluemix Meetup April 20th 2016
 
Wading through treacle? Escape the integration syrup with contract tests
Wading through treacle? Escape the integration syrup with contract testsWading through treacle? Escape the integration syrup with contract tests
Wading through treacle? Escape the integration syrup with contract tests
 
MACHINE LEARNING AUTOMATIONS PIPELINE WITH CI/CD
MACHINE LEARNING AUTOMATIONS PIPELINE WITH CI/CDMACHINE LEARNING AUTOMATIONS PIPELINE WITH CI/CD
MACHINE LEARNING AUTOMATIONS PIPELINE WITH CI/CD
 
Microsoft DevOps Solution - DevOps
Microsoft DevOps Solution - DevOps  Microsoft DevOps Solution - DevOps
Microsoft DevOps Solution - DevOps
 
UrbanCode Deploy course and product overview slides
UrbanCode Deploy course and product overview slidesUrbanCode Deploy course and product overview slides
UrbanCode Deploy course and product overview slides
 
Cloud-Native Fundamentals: Accelerating Development with Continuous Integration
Cloud-Native Fundamentals: Accelerating Development with Continuous IntegrationCloud-Native Fundamentals: Accelerating Development with Continuous Integration
Cloud-Native Fundamentals: Accelerating Development with Continuous Integration
 
The Reality of Managing Microservices in Your CD Pipeline
The Reality of Managing Microservices in Your CD PipelineThe Reality of Managing Microservices in Your CD Pipeline
The Reality of Managing Microservices in Your CD Pipeline
 
Overview
OverviewOverview
Overview
 
OSSF 2018 - Brandon Jung of GitLab - Is Your DevOps 'Tool Tax' Weighing You D...
OSSF 2018 - Brandon Jung of GitLab - Is Your DevOps 'Tool Tax' Weighing You D...OSSF 2018 - Brandon Jung of GitLab - Is Your DevOps 'Tool Tax' Weighing You D...
OSSF 2018 - Brandon Jung of GitLab - Is Your DevOps 'Tool Tax' Weighing You D...
 
Citi Tech Talk: Messaging Modernization
Citi Tech Talk: Messaging ModernizationCiti Tech Talk: Messaging Modernization
Citi Tech Talk: Messaging Modernization
 
Four Steps Toward a Safer Continuous Delivery Practice (Hint: Add Monitoring)
Four Steps Toward a Safer Continuous Delivery Practice (Hint: Add Monitoring)Four Steps Toward a Safer Continuous Delivery Practice (Hint: Add Monitoring)
Four Steps Toward a Safer Continuous Delivery Practice (Hint: Add Monitoring)
 
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
 
DevOps on AWS - Building Systems to Deliver Faster
DevOps on AWS - Building Systems to Deliver FasterDevOps on AWS - Building Systems to Deliver Faster
DevOps on AWS - Building Systems to Deliver Faster
 
Twelve factor-app
Twelve factor-appTwelve factor-app
Twelve factor-app
 

Recently uploaded

Recently uploaded (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

Consumer Driven Contracts for microservices

  • 1. Consumer Driven Contracts for Microservices By Reshmi Krishna By Vinay Upadhya @reshmi9k @vinayu
  • 2. About Us Reshmi Krishna ● Software Engineer ● Platform Architect, Pivotal Cloud Foundry ● Women In Tech Community Member Twitter : @reshmi9k MeetUp : Cloud-Native-New-York Vinay Upadhya ● Software Engineer ● Platform Architect, Pivotal Cloud Foundry ● Application Architecture Evangelist Twitter : @vinayu
  • 3. Agenda What are Consumer Driven Contracts? What problems are we trying to solve? Spring Cloud Contract for microservices Demo
  • 4. What are Consumer Driven Contracts? Internal Marketing App External Reseller App Product Search Service A P I { catalogid, name, price, manufacturer } { catalogid, name, price } Product Schema { catalogid, name, price, manufacturer, inStock } Producer Contract Expectation Consumer Contract Consumer Driven Contract
  • 5. What are Consumer Driven Contracts ( CDC ) Not a new concept but becoming more prevalent in today’s world of microservices. It is a pattern for evolving services and their API’s without breaking backward or forward compatibility. CDC driven testing is TDD applied at an architectural level of the project.
  • 6. What problems are we trying to solve? 1. Provide a framework for consumers to set expectations with consumer contracts and drive the producer API. 2. Producer test lifecycle includes validating consumer contracts. 3. Provide reusable producer stubs for consumers to use in their integration tests. 4. Minimize E2E integration tests.
  • 7. Spring Cloud Contract Spring Cloud Contract provides support for CDC and service schemas in Spring Apps. Being part of Spring Cloud it can help stub out Spring Cloud components like Eureka, Consul etc. Comprised of three main projects :- Spring Cloud Contract Verifier : Library on server side to test if the server isn’t breaking any consumer contracts. Spring Cloud Contract Wiremock : Wrapper around wiremock to help start stubs with wiremock json stubs. Spring Cloud Contract Stub Runner : Helper library to pull stubs from maven and run them
  • 8. What is a contract?
  • 9. Demo I want to login Can Reshmi/123 login ? YES !!!! OK
  • 10. Demo I want to login Can Vinay/321 login ? No !!!! NOT_OKAY
  • 11. Typical CDC Flow Consumer Phase 1 Producer Phase Consumer Phase 2 Consumer Offline Work Producer Implementing Feature Consumer Online Work
  • 12. Consumer Flow 1 (Login Client) Start TDD - writes the test for the feature Write the missing implementation Clone the Producer (LoginServerService) repository locally Define the contract locally in the repo of Producer Add the Spring Cloud Contract Verifier plugin Run the integration tests
  • 13. Producer Flow (Login Server) Take over the PR Write the missing implementation that will make the autogenerated tests pass Merge PR and deploys the JARs with the app and the stubs
  • 14. Consumer Flow 2 (Login Client) 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
  • 15. Demo : Add additional parameter to login Login Validate(UN,PWD,AC) Response Response
  • 16. Resources Docs : https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html MeetUp Demo : https://github.com/reshmik/spring-cloud-contract-login-demo.git Consumer Driven Contracts (MarcinGrzejszczak) : http://www.slideshare.net/MarcinGrzejszczak/consumer-driven-contracts- and-your-microservice-architecture-67641511 More Samples : https://github.com/spring-cloud/spring-cloud-contract/tree/1.0.x/samples Talk to the SpringCloudContract Team : https://gitter.im/spring-cloud/spring-cloud-contract