Using Pact to Deploy Microservice with Confidence - Mark Bradley, Armakuni

Learn how PACT enables confident microservice deployment through consumer-driven contract testing. Discover best practices for API testing and safe deployment validation.

Key takeaways
  • PACT is a consumer-driven contract testing tool that helps deploy microservices with confidence by verifying API contracts between consumers and producers

  • Contracts are created through consumer tests, containing only the fields and interactions actually used, rather than full API specifications

  • PACT helps teams move fast without breaking things by validating API changes are safe before deployment using “can I deploy?” checks

  • The PACT Broker acts as a repository for contracts, enabling version tracking and compatibility checks between consumer-producer pairs

  • PACT works best for internal APIs and microservice communications rather than public APIs

  • Testing happens at the unit test level, replacing traditional mocking while verifying real interactions

  • Contracts only contain the fields and endpoints actually used by consumers, helping identify what’s safe to deprecate

  • PACT supports multiple languages and frameworks including Go, Java, JavaScript, PHP and others

  • The tool integrates into CI/CD pipelines to verify contract compatibility before deployment

  • Teams can gradually adopt PACT by starting with single endpoints/consumers and expanding coverage over time

  • PACT enables async API testing and supports multiple protocols beyond just HTTP REST APIs

  • The tool helps teams identify which consumers use specific API fields, making it safer to evolve APIs over time