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

apidays Paris 2024 - Contract-Driven Developmen...

apidays
December 22, 2024

apidays Paris 2024 - Contract-Driven Development for Event-Driven Architectures, Hari Krishnan and Joel Rosario, Specmatic

Contract-Driven Development for Event-Driven Architectures
Hari Krishnan, CTO & Co-Founder at Specmatic
Joel Rosario, Chief Scientist at Specmatic

apidays Paris 2024 - The Future API Stack for Mass Innovation
December 3 - 5, 2024

------

Check out our conferences at https://www.apidays.global/

Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8

Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io

Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/

apidays

December 22, 2024
Tweet

More Decks by apidays

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