These scripts exercise the v2.0.0 JavaScript surface with the new constructors:
ProducerConsumerAdminClient
The suite is organized as:
smoke/: fast single-run checks for core topic lifecycle and produce/consume flowintegration/: richer flows for consumer groups and Schema Registry happy paths
Reference:
- v2 API docs:
api-docs/v2/docs/README.md
These scripts assume a local Kafka + Schema Registry environment, such as the existing Lenses.io Fast Data Dev container.
Environment variables:
XK6_KAFKA_BROKERS: comma-separated bootstrap servers. Default:localhost:9092XK6_KAFKA_SCHEMA_REGISTRY_URL: Schema Registry base URL. Default:http://localhost:8081XK6_KAFKA_RUN_ID: optional stable suffix for topic naming. Defaults toDate.now()
Examples:
./k6 run scripts/v2/smoke/basic.js
./k6 run scripts/v2/integration/consumer_group.js
./k6 run scripts/v2/integration/avro_schema_registry.js
./k6 run scripts/v2/integration/json_schema_registry.jsEach script creates a deterministic per-run topic name, validates the expected flow, and deletes the topic in teardown().