iluwatar / iluwatar/java-design-patterns

Microservice pattern: Consumer-driven contract test

Open
#2,675 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

epic: pattern info: help wanted status: stale type: feature
Dominant language
Java
Stars
94.7k
Forks
27.4k
Avg merge
3d 4h
Merged PRs (30d)
10

Description

Description:
The Microservices - Service Integration Contract Test design pattern ensures that microservices can communicate and function together as expected. This pattern involves creating and maintaining contract tests that verify the interactions between microservices. These tests help to ensure that changes in one service do not break the functionality of another service, thereby maintaining the integrity of the entire system.

Main elements of the pattern include:

  1. Service Contracts: Define clear and precise contracts for each service, specifying the expected inputs and outputs.
  2. Consumer-driven Contracts: Consumers of a service define the expectations, which are then verified by the service provider.
  3. Automated Tests: Develop automated tests that validate the interactions based on the defined contracts.
  4. Versioning: Manage and test multiple versions of service contracts to ensure backward compatibility.
  5. Continuous Integration: Integrate contract tests into the CI/CD pipeline to detect and fix issues early in the development process.

References:

Acceptance Criteria:

  1. Create service contracts for a sample microservices setup.
  2. Implement consumer-driven contract tests and integrate them into the CI/CD pipeline.
  3. Verify that contract tests detect any breaking changes in service interactions and provide actionable feedback.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no repository files, tests, or entry points to inspect. Begin by determining how a sample microservices setup and its service contracts should fit this Java project, then review the contribution guidelines and referenced service-integration pattern. Done means consumer-driven contract tests cover the sample, run in CI/CD, detect breaking interactions, and provide actionable feedback.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.