Enterprise · Kafka

Test event-driven
architectures with
native Kafka support.

Send messages, listen on topics, assert on payloads — using the same Karate syntax you already use for REST. Avro, multiple listeners, consumer groups, and SASL authentication all built in.

Also available: gRPC · WebSocket

kafka-test.feature
Feature: Order processing pipeline

Background:
  * bootstrap 'broker1:9092,broker2:9092'

Scenario: Produce and consume order event
  # Publish an order
  Given topic 'orders.created'
  And key 'order-123'
  And value
    { id: 123, item: 'Laptop', qty: 1 }
  When send

  # Listen for the processed event
  Given topic 'orders.processed'
  And group 'karate-tests'
  When listen 5000
  Then match listen.value ==
    { id: 123, status: 'COMPLETE',
      timestamp: '#notnull' }

Kafka-Specific Features

Everything you need for Kafka testing

Avro Schema Support

Work with Avro-encoded messages natively. Schema registry integration handled for you — no custom serializers to maintain.

Multiple Listeners

Subscribe to multiple topics concurrently within a single test. Each listener runs on its own thread, managed by Karate.

SASL & mTLS

Production authentication out of the box — SASL/PLAIN, SASL/SCRAM, SASL/GSSAPI, and mutual TLS with cert rotation.

Consumer Groups

Full consumer group management including offset control, rebalancing behavior, and seek-to-beginning for replay testing.

Parallel Execution

Run thousands of Kafka tests in parallel. Built-in support for Gatling performance testing with your existing feature files.

Mix with REST, gRPC, UI

POST via REST, assert a Kafka event, verify the database via gRPC — all in the same scenario. End-to-end in one file.

When to Use Kafka Testing

Perfect for event-driven teams

Microservices event choreography

Verify that publishing to one topic triggers the right chain of downstream events across services.

CDC (Change Data Capture) pipelines

Assert that database changes surface in the right Kafka topics with the correct schema and ordering.

Event sourcing & replay testing

Seek to specific offsets and replay historical events to validate state reconstruction logic.

Kafka Connect & Streams validation

Test connector output, stream transformations, and KTable state without spinning up custom harness code.

Licensing

Karate Kafka requires an Enterprise runtime license for CI/CD deployment and the Pro tier of IntelliJ or VS Code plugins for development.

Get Pricing

Ready to test your Kafka pipelines?

Book a 30-minute demo tailored to your Kafka setup — topics, schemas, auth, and all.