Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Contract-Driven Development for Event-Driven Ar...

Contract-Driven Development for Event-Driven Architectures

Slides for API Days Paris 2024 (https://www.apidays.global/paris/) / AsyncAPI Conf Paris 2024 (https://conference.asyncapi.com/venue/Paris)

Are you interested in migrating smoothly from AsyncAPI 2.6.0 to AsyncAPI 3.0.0 while getting an in-depth understanding of the request/reply pattern for contract testing and mocking? This is the talk for you. In this session we demonstrate safe migration strategies and highlight the power of leveraging AsyncAPI Spec as executable contracts.

HariKrishnan

December 13, 2024
Tweet

More Decks by HariKrishnan

Other Decks in Programming

Transcript

  1. Hari Krishnan Co-Founder, CTO at Specmatic [email protected] @harikrishnan83 Transformation Advisor

    Coach and Trainer API Governance Strategist Joel Rosario Co-Founder, Chief Scientist at Specmatic [email protected] @finalprefix Consultant and coach Agile software development Contract Driven Development
  2. © 2024 All Rights Reserved Architecture of our System Under

    Test Order Service place-order process-order cancel-order process-cancellation Request Reply Request Reply
  3. © 2024 All Rights Reserved Live Demo Contract testing with

    AsyncAPI 2.6 (convention-based Request Reply pattern)
  4. © 2024 All Rights Reserved Migrating from AsyncAPI 2.6 to

    3.0 • Native support ”request-reply” pattern • Define “correlationId” • Support for dynamic reply topic • And more
  5. © 2024 All Rights Reserved How do we migrate safely?

    Without introducing unintended change in behavior
  6. Automated Spec vs Spec Compatibility Check 3.0.0 2.6.0 Contract Test

    Mock (In-memory / persistent Kafka Broker) Request Message Reply Message
  7. © 2024 All Rights Reserved Running Contract Tests Using the

    3.0.0 spec to run contract test against service implementation
  8. © 2024 All Rights Reserved Contract Test Setup Contract as

    Test Request Reply API (System under Test) Consumer Business Logic Topics Offset validation Payload schema Counts API-Specification.yaml Payload validation Producer Send Verify Request Reply Send Verify Receive Topic request Send Topic reply Send Topic reply Receive Topic request Example Data
  9. © 2024 All Rights Reserved Live Demo Using the 3.0.0

    spec to run contract test for “request-reply“ pattern
  10. © 2024 All Rights Reserved Mock based on v3.0.0 spec

    Allow applications integrating with our service make independent progress
  11. © 2024 All Rights Reserved Mocking 3.0.0 Mock (In-memory Kafka

    Broker) Receive Topic request Send Topic reply Send Topic reply Receive Topic request Payload validation Examples 3.0.0 Contract Test
  12. © 2024 All Rights Reserved Importance of Example Validation Slide

    by Frank Kilcommins - https://www.linkedin.com/in/frank-kilcommins/
  13. © 2024 All Rights Reserved Contract Driven Development – API

    Governance in a nutshell Consumer Provider API Design First • Shift Left all the way to Design • Reduced time-to-market due to Parallel Development • Enhanced DevEx with improved Collaboration • Resilient API Building Blocks