Sign inSign up

specmatic/specmatic-kafka

By specmatic

Updated 9 months ago

Image
0

8.5K

specmatic/specmatic-kafka repository overview

Specmatic Kafka

specmatic-kafka is designed to work with Kafka's event-driven architecture using AsyncAPI specifications, offering all the power of contract-driven development using advanced no-code capabilities. The module has a default license that will allow you to experiment with all features to a limited extent. For license related details please reach out to us here

Transform your AsyncAPI Specifications into Executable Contracts with #NoCode in Seconds

Experience the power of Contract-Driven Development to confidently develop and independently deploy your Microservices and Microfrontends faster

Quick Start Commands
1. Executing Specmatic-Kafka Tests

First, create a Specmatic configuration file that includes the specification outlined in the provides section. For example:

version: 2
contracts
  - provides:
      - asyncapi.yaml

For more information on configuration options, please consult the Specmatic Config Documentation

Next, execute the Specmatic-Kafka test command as follows:

docker run --network="host" -v "$(pwd)/specmatic.yaml:/usr/src/app/specmatic.yaml" -v "$(pwd)/asyncapi.yaml:/usr/src/app/asyncapi.yaml" specmatic/specmatic-kafka test --broker="localhost:9092"

Uses the AsyncAPI specification file asyncapi.yaml to run contract tests against the service also connected to the Kafka broker running at localhost:9092

2. Running Specmatic-Kafka Service Virtualization
docker run -p "9092:9092" -p "9999:9999" -v "$(pwd)/asyncapi.yaml:/usr/src/app/asyncapi.yaml" specmatic/specmatic-kafka virtualize --spec-file "asyncapi.yaml"
  • Starts a Specmatic Kafka mock server using the AsyncAPI specification asyncapi.yaml at localhost:9092 for broker and http://localhost:9999 for API Server
  • Optionally, you can specify an external Kafka broker with the --broker argument, if omitted, Specmatic Kafka will start an embedded broker on localhost:9092
  • Following the above, you can now set and verify expectations, for more information please refer to Specmatic Kafka Virtualization Documentation
3. See full list of commands
docker run specmatic/specmatic-kafka --help

Please refer to Specmatic Kafka documentation for more details

Sample projects to see full usage

Specmatic Kafka Sample
AsyncAPI V3 Sample
Specmatic Kafka Sample using Avro Schema

Context

In a complex, interdependent ecosystem, where each service is evolving rapidly, we want to make the dependencies between them explicit in the form of executable contracts. Contract Driven Development leverages API specifications like OpenAPI, AsyncAPI, GraphQL SDL files, gRPC Proto files, etc. as executable contracts allowing teams to get instantaneous feedback while making changes to avoid accidental breakage.

With this ability, we can now independently deploy, at will, any service at any time without having to depend on expensive and fragile integration tests.

Learn more at specmatic.io 🌐

Specmatic - Contract Driven Development

YouTube playlist 📺

Tag summary

Content type

Image

Digest

sha256:4f900adf0

Size

184.1 MB

Last updated

9 months ago

docker pull specmatic/specmatic-kafka