Redis Streams Endpoint
Use Redis Streams for producer and consumer correlation with consumer groups and stream retention controls.
Core Fields
Configure ConnectionString, StreamKey, and Mode. ConsumerGroup and ConsumerName are required for consume mode so LoadStrike can read and acknowledge stream entries deterministically.
Read Behavior
Use StartFromEarliest to control first-read position and ReadCount to bound batch size per poll. This keeps stream polling predictable under sustained correlation workloads.
Retention And Payload Shape
MaxLength can be used to cap stream growth on produce. Payloads are stored with body, content-type, and header:* fields so tracking selectors can still read from headers or body.
Tracking Extraction
TrackingField and optional GatherByField use the same header/json selector syntax as other endpoints. MessagePayloadType and serializer settings are used when tracking id lives in the stream body.
Feature Usage Samples
How to use snippets for Redis Streams Endpoint.
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.
Redis Streams Endpoint
var endpoint = new RedisStreamsEndpointDefinition
{
Name = "redis-stream-out",
Mode = TrafficEndpointMode.Consume,
TrackingField = TrackingFieldSelector.Parse("json:$.trackingId"),
ConnectionString = "localhost:6379",
StreamKey = "orders.completed",
ConsumerGroup = "loadstrike-orders",
ConsumerName = "consumer-1",
ReadCount = 50
};
import com.loadstrike.runtime.LoadStrikeCorrelation.TrackingFieldSelector;
import com.loadstrike.runtime.LoadStrikeTransports;
import com.loadstrike.runtime.RedisStreamsEndpointDefinition;
var endpoint = new RedisStreamsEndpointDefinition();
endpoint.name = "redis-stream-out";
endpoint.mode = LoadStrikeTransports.TrafficEndpointMode.Consume;
endpoint.trackingField = TrackingFieldSelector.parse("json:$.trackingId");
endpoint.connectionString = "localhost:6379";
endpoint.streamKey = "orders.completed";
endpoint.consumerGroup = "loadstrike-orders";
endpoint.consumerName = "consumer-1";
endpoint.readCount = 50;
from loadstrike_sdk import RedisStreamsEndpointDefinition, TrackingFieldSelector
endpoint = RedisStreamsEndpointDefinition(
name="redis-stream-out",
mode="Consume",
tracking_field=TrackingFieldSelector.parse("json:$.trackingId"),
connection_string="localhost:6379",
stream_key="orders.completed",
consumer_group="loadstrike-orders",
consumer_name="consumer-1",
read_count=50,
)
import { RedisStreamsEndpointDefinition, TrackingFieldSelector } from "@loadstrike/loadstrike-sdk";
const endpoint = new RedisStreamsEndpointDefinition({
name: "redis-stream-out",
mode: "Consume",
trackingField: TrackingFieldSelector.parse("json:$.trackingId"),
connectionString: "localhost:6379",
streamKey: "orders.completed",
consumerGroup: "loadstrike-orders",
consumerName: "consumer-1",
readCount: 50
});
const { RedisStreamsEndpointDefinition, TrackingFieldSelector } = require("@loadstrike/loadstrike-sdk");
const endpoint = new RedisStreamsEndpointDefinition({
name: "redis-stream-out",
mode: "Consume",
trackingField: TrackingFieldSelector.parse("json:$.trackingId"),
connectionString: "localhost:6379",
streamKey: "orders.completed",
consumerGroup: "loadstrike-orders",
consumerName: "consumer-1",
readCount: 50
});
Body Example
Specifies how the adapter connects to Redis.
Specifies the Redis stream key used for produce or consume mode.
Specifies the Redis consumer group used for coordinated stream reads.
Identifies the current reader inside the Redis consumer group.
Controls how many stream entries the adapter asks for in one polling cycle.
{ "trackingId": "trk-1", "status": "completed" }