Kafka Protocol Guide

Best practices for produce/consume correlation at scale.

Throughput and Lag

Tune poll intervals, batch sizes, and timeout windows for stable correlation.

Feature Usage Samples

How to use snippets for Kafka Protocol Guide.

Switch between C#, Java, Python, TypeScript, and JavaScript to see the native SDK shape for this sample.

Licensing note: every runnable sample requires a valid runner key via WithRunnerKey("...") or config key LoadStrike:RunnerKey.

Kafka Protocol Setup

var source = new KafkaEndpointDefinition { Name = "in", Mode = TrafficEndpointMode.Produce, TrackingField = TrackingFieldSelector.Parse("json:$.trackingId"), BootstrapServers = "localhost:9092", Topic = "orders.in" };
var destination = new KafkaEndpointDefinition { Name = "out", Mode = TrafficEndpointMode.Consume, TrackingField = TrackingFieldSelector.Parse("json:$.trackingId"), BootstrapServers = "localhost:9092", Topic = "orders.out", ConsumerGroupId = "orders-tests" };

Goal

Same tracking selector

Use the same tracking field on the producer and consumer sides so the two messages can be matched correctly.

Stable message shape

Keep the tracked field in a stable header or JSON location so the selector resolves consistently.

Diagram

Protocol stack diagram
Protocol adapters normalize tracking and correlation across heterogeneous transports.