Slide 1

Slide 1 text

Kafka and JMS Mocking with AsyncAPI using Specmatic Hari Krishnan Co-Founder and CTO at Specmatic AACoT’23 AACoT’23

Slide 2

Slide 2 text

© 2023 All Rights Reserved Production Architecture Request Response Request Response 1 2 3 4 5 Message Topic Domain Service App BFF Analytics Service

Slide 3

Slide 3 text

© 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

Slide 4

Slide 4 text

© 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

Slide 5

Slide 5 text

© 2023 All Rights Reserved Live Demo

Slide 6

Slide 6 text

© 2023 All Rights Reserved Kafka Mock Validations Invoke Service A Service B 2 3 1

Slide 7

Slide 7 text

© 2023 All Rights Reserved Integration testing is not an option

Slide 8

Slide 8 text

© 2023 All Rights Reserved API Specifications as Executable Contracts Consumer Provider Service Virtualization Contract as Test

Slide 9

Slide 9 text

© 2023 All Rights Reserved AsyncAPI spec as Test Request Reply Pattern

Slide 10

Slide 10 text

© 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

Slide 11

Slide 11 text

© 2023 All Rights Reserved Single source of truth Service A Service B

Slide 12

Slide 12 text

© 2023 All Rights Reserved Central Contract Repo – Contract as Code

Slide 13

Slide 13 text

© 2023 All Rights Reserved Shift-left and kill integration tests

Slide 14

Slide 14 text

© 2023 All Rights Reserved https://insights.specmatic.in/

Slide 15

Slide 15 text

© 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

Slide 16

Slide 16 text

© 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

Slide 17

Slide 17 text

@harikrishnan83 hari@xnsio.com https://specmatic.in/ Thank you!

Slide 18

Slide 18 text

Credits • Logos (OpenAPI, Swagger, WSDL, AsyncAPI, Kafka, ActiveMQ, JMS, Redis, JDBC) - Third party marks and brands are the property of their respective holders