Google News
logo
Java Spring Boot - Interview Questions
What is Spring Cloud Contract?
Spring Cloud Contract implements the Consumer Driven Contracts (CDC) approach via the 'Spring Cloud Contract Verifier' project.
 
Consumer Driven Contracts is a software development and evolution approach where each consumer of service develops a contract that contains the consumer's expectations about the APIs provided by Service. The full collection of all of the consumers' contracts constitutes the requirement set for the service.
 
Once the service owners have all of the contracts for their consumers, the service owners can develop a test suite that verifies the service APIs. This test suite provides rapid feedback about failures when the service changes.
 
In Spring Cloud Contract, a "producer" is the owner of an API and a "consumer" is the user of an API.
 
Service A (as a consumer) creates a contract that service B (as a producer) will have to abide by. This contract acts as the invisible glue between services - even though they live in separate code bases and run on different JVMs. Breaking changes can be detected immediately during build time.
Advertisement