CloudEvents HTTP gateway smoke
This smoke demo exercises the implemented gateway CloudEvents path:
- HTTP binary and structured CloudEvents ingress.
- Kafka records carrying
ce_*headers and barecontent-type. - Outbound webhook egress in CloudEvents binary and structured modes.
The fully automated in-process regression is:
cargo test -p krabka-gateway --test cloudevents_roundtrip
Files
webhooks.tomldefines a named HTTP ingress endpoint at/v1/webhooks/eventsthat writes tocloudevents-demo.outbound-webhooks.tomldefines two outbound webhook subscriptions from the same topic: onecloud_events_binary, onecloud_events_structured.smoke.shstarts a local webhook capture server on127.0.0.1:18080, posts a binary event to/v1/produce/{topic}, posts a structured event to the named ingress endpoint, and waits until both CloudEvents egress shapes arrive.
Run
After the broker is listening, create the topic cloudevents-demo with your
normal Kafka-compatible admin tooling before starting the gateway. This
repository does not ship a standalone topic-admin CLI; the regression test above
creates the topic programmatically.
Start a broker and gateway from the repository root in separate terminals:
cargo run -p krabka-broker --bin krabka-broker -- \
--listen-addr 127.0.0.1:9092 \
--advertised-listener 127.0.0.1:9092
KRABKA_GATEWAY_ADVERTISED_ADDR=127.0.0.1:9500 \
cargo run -p krabka-gateway --bin krabka-gateway -- \
--bootstrap-servers 127.0.0.1:9092 \
--listen-addr 127.0.0.1:9500 \
--webhooks-config demo/cloudevents/webhooks.toml \
--outbound-webhooks-config demo/cloudevents/outbound-webhooks.toml
Then run the smoke:
demo/cloudevents/smoke.sh
Override endpoints when needed:
KRABKA_GATEWAY_URL=http://127.0.0.1:9500 \
KRABKA_CE_TOPIC=cloudevents-demo \
KRABKA_CE_CAPTURE_PORT=18080 \
demo/cloudevents/smoke.sh