iggy-gateway-kafka)Foundation layer for apache/iggy#3421: a TCP listener on the Kafka wire port that decodes requests, validates scoped API keys and versions, and returns stub responses.
Stub warning: no API persists or reads real data yet. Produce, Fetch, and ListOffsets return retriable
NOT_LEADER_OR_FOLLOWER(6) so clients keep data locally / retry elsewhere instead of trusting a fake success. CreateTopics does not create topics; valid requests returnNOT_CONTROLLER(41). Metadata still reports requested topics as unknown. Persistence lands with the Iggy bridge (see docs/SCOPE.md).
cargo run -p iggy-gateway-kafka
Default bind: 127.0.0.1:9093. Environment variables:
| Variable | Default | Description |
|---|---|---|
IGGY_KAFKA_BIND_ADDR | 127.0.0.1:9093 | TCP address to listen on |
IGGY_KAFKA_ADVERTISED_HOST | bind IP | Hostname/IP clients use to reach this broker (required when binding to 0.0.0.0/::) |
IGGY_KAFKA_ADVERTISED_PORT | bind port | Port advertised in Metadata responses |
IGGY_KAFKA_MAX_CONNECTIONS | 1024 | Maximum concurrent connections before new ones are rejected |
IGGY_KAFKA_MAX_FRAME_SIZE | 8388608 | Maximum accepted request frame size in bytes |
IGGY_KAFKA_IDLE_TIMEOUT_SECS | 600 | Seconds a connection may sit idle before the next frame's length prefix arrives |
IGGY_KAFKA_READ_TIMEOUT_SECS | 15 | Seconds allowed to read a frame body once its length prefix arrives |
IGGY_KAFKA_WRITE_TIMEOUT_SECS | 10 | Seconds allowed to write a response frame |
IGGY_KAFKA_SHUTDOWN_DRAIN_TIMEOUT_SECS | 25 | Seconds graceful shutdown waits for in-flight connections before abandoning them |
cargo test -p iggy-gateway-kafka
See docs/TEST_SUITE.md for the full suite catalog (cargo test -p iggy-gateway-kafka -- --list for the exact current test names - the count has drifted out of sync with the actual suites before, so it isn't pinned here).
Some api_handler_tests, server_e2e_tests, and version_firewall_tests cases require wire fixtures under tools/kafka-tool/kafka_messages/ (gitignored locally; CI generates them via scripts/ci-wire-fixtures.sh):
./gateways/kafka/scripts/ci-wire-fixtures.sh generate cargo test -p iggy-gateway-kafka ./gateways/kafka/scripts/ci-wire-fixtures.sh cleanup # optional
Or generate only the keys the tests need:
for key in 0 1 2 19; do cargo run -p kafka-message-gen -- generate \ --output gateways/kafka/tools/kafka-tool/kafka_messages \ --api-key "$key" done
Before check-in, run the procedure in docs/MANUAL_TESTING.md (smoke, version firewall, kcat, adversarial cases).
See docs/SCOPE.md for #3421 deliverables, supported API key/version table, and post-foundation TODO backlog.