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

Kafka and JMS Mocking with AsyncAPI using Specm...

Kafka and JMS Mocking with AsyncAPI using Specmatic

AsyncAPI allows us to articulate communication channels between services clearly. What if I told you that we can leverage the same AsyncAPI specification to quickly spin up mock topics and queues to test our services in isolation?

That is exactly what Specmatic is able to achieve by leveraging AsyncAPI specifications to give us early feedback on our local machines and in our CI pipelines when our service implementations deviate from the API specifications.
That is exactly what Specmatic is able to achieve by leveraging AsyncAPI specifications to give us early feedback on our local machines and in our CI pipelines when our service implementations deviate from the API specifications.

In this talk I will be going over below points with live demos.
1. Ability to detect deviations in implementation at a protocol, schema level and more during early stages of development to shift left the identification of potential integration issues.
2. Leveraging AsyncAPI specifications to collaborate between teams to develop and deploy microservices in parallel with confidence to adopt an API Design first approach
3. How this ability fits into the overall concept of Contract Driven Development

HariKrishnan

November 30, 2023
Tweet

More Decks by HariKrishnan

Other Decks in Programming

Transcript

  1. Kafka and JMS Mocking with AsyncAPI using Specmatic Hari Krishnan

    Co-Founder and CTO at Specmatic AACoT’23 AACoT’23
  2. © 2023 All Rights Reserved Production Architecture Request Response Request

    Response 1 2 3 4 5 Message Topic Domain Service App BFF Analytics Service
  3. © 2023 All Rights Reserved System Under Test Dependencies Test

    Test Mode Request Response Request Response 1 2 3 4 5 Message Topic Domain Service App BFF Analytics Service
  4. © 2023 All Rights Reserved Dependencies System Under Test Test

    Test Mode – Contract Test Setup Request Response Request Response 1 3 4 5 Message Contract Test Http Stub Kafka mock Broker (In-memory) Schema Validation Topic BFF Set Expectations 2 Set Expectations Verify message count and schema 7 8 6
  5. © 2023 All Rights Reserved API Specifications as Executable Contracts

    Consumer Provider Service Virtualization Contract as Test
  6. © 2023 All Rights Reserved AsyncAPI Spec as Test (Request

    Reply Pattern) Contract as Test Request Reply API (System under Test) Consumer Business Logic Topics Offset validation Payload schema Counts API-Specification.yaml specmatic.json Payload validation Producer Send Verify Request Reply Send Verify Publish Topic commandRequest Subscribe Topic commandReply Subscribe Topic commandReply Publish Topic commandRequest Test data jsons
  7. © 2023 All Rights Reserved BFF Controller Service BFF Controller

    Service JMS Mock Production Mode Test Mode 1 2 3 4 5 6 6 7 8 9 1 2 1 3 Set Expectations 2 Domain Service 7 HTTP stub 3 Set Expectations Broker (In-memory) Queue Schema Validation Verify Message Count & Schema 1 1 4 4 1 0 5 1 1 JMS Mocking using AsyncAPI https://specmatic.in/updates/jms-mocking-with-asyncapi-using-specmatic
  8. © 2023 All Rights Reserved Summary of supported capabilities https://specmatic.in/updates/jdbc-stubbing-with-specmatic-contract-testing

    https://specmatic.in/updates/redis-stubbing-with-specmatic-contract-testing And more… https://specmatic.in/category/features
  9. Credits • Logos (OpenAPI, Swagger, WSDL, AsyncAPI, Kafka, ActiveMQ, JMS,

    Redis, JDBC) - Third party marks and brands are the property of their respective holders