Redis Streams Endpoint

Use the Redis Streams endpoint when LoadStrike needs stream publish or consume behavior with predictable correlation settings.

What this page helps you do

What this page helps you do

Use the Redis Streams endpoint when LoadStrike needs stream publish or consume behavior with predictable correlation settings.

Who this is for

Teams defining the transport-specific source or destination side of a correlated transaction.

Prerequisites

  • A stable tracking field shared between the producer side and the consumer or completion side

By the end

A transport definition that matches the transaction you need to measure.

Use this page when

Use this page when Redis Streams Endpoint is the source or destination side of the transaction and you need the documented endpoint fields before wiring the scenario.

Visual guide

Transaction diagram showing source action, handoff, downstream processing, and completion.
The settings on this page only make sense when the workflow is treated as one transaction from source action to downstream completion.

Guide

Core Fields

Start with 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 where consumption begins and ReadCount to cap the batch size for each poll. This keeps stream polling predictable under sustained correlation workloads.

Retention And Payload Shape

MaxLength can cap stream growth on produce. Payloads are stored with body, content-type, and header:* fields so tracking selectors can still read from either headers or body.

Tracking Extraction

TrackingField and optional GatherByField use the same header or JSON selector syntax as other endpoints. The selector prefix is case-insensitive, but header names and JSON path segments are exact-case. MessagePayloadType and serializer settings are used when the tracking ID lives in the stream body.

Endpoint definition samples

Use these samples to see how Redis Streams Endpoint is represented as a source or destination endpoint before you attach it to a correlated scenario.

If you run these examples locally, add a valid runner key before execution starts. Set it with WithRunnerKey("...") or the config key LoadStrike:RunnerKey.

Redis Streams Endpoint

using LoadStrike;

var tracking = new CrossPlatformTrackingConfiguration
{
    Source = new HttpEndpointDefinition
    {
        Name = "orders-api",
        Mode = TrafficEndpointMode.Produce,
        TrackingField = TrackingFieldSelector.Parse("json:$.trackingId"),
        Url = "https://api.example.com/orders",
        Method = "POST",
        MessagePayload = new { trackingId = "trk-1001", amount = 49.95m }
    },
    Destination = 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
    }
};

var scenario = CrossPlatformScenarioConfigurator
    .Configure(LoadStrikeScenario.Empty("orders-http-to-redis-streams"), tracking)
    .WithLoadSimulations(LoadStrikeSimulation.Inject(10, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(20)));

LoadStrikeRunner.RegisterScenarios(scenario)
    .WithRunnerKey("rkl_your_local_runner_key")
    .Run();

Redis Streams endpoint fields and parameters

Name

Required endpoint identifier. It appears in correlation tables, sink exports, and troubleshooting messages, so choose a stable descriptive name.

Mode

Choose Produce when LoadStrike should create traffic, or Consume when it should listen for downstream traffic. Run mode validation checks that the selected mode matches the source or destination role.

TrackingField

Selector that extracts the correlation id from a header or JSON body. It is normally required, but can be omitted when UseLoadStrikeTraceIdHeader is true so LoadStrike uses header:loadstrike-trace-id for generated source traffic. Selector prefixes such as header: and json: are parsed case-insensitively, but the header name or JSON path segments after the prefix must match exact casing. The extracted value is matched case-sensitively by default unless TrackingFieldValueCaseSensitive is turned off on the tracking configuration.

GatherByField

Optional destination-only selector used for grouped correlation reports. It follows the same selector-casing rules as TrackingField. Group values are grouped case-sensitively by default unless GatherByFieldValueCaseSensitive is turned off on the tracking configuration.

AutoGenerateTrackingIdWhenMissing

Defaults to true. When the source payload does not already contain the tracked id, LoadStrike can inject one so the generated traffic still produces a correlation key.

UseLoadStrikeTraceIdHeader

Defaults to false. When true and TrackingField is omitted, produced source messages receive a loadstrike-trace-id header with a GUID value. Consume-mode source endpoints and CorrelateExistingTraffic runs do not inject this header; they only observe it if the existing traffic already contains it.

PollInterval

Controls how often a consumer-style endpoint polls for new messages. The value must stay greater than zero whenever you set it explicitly.

MessageHeaders

Optional headers that are written with produced traffic and also influence tracking extraction when the selector targets headers. Header names are preserved exactly as you set them, and header selectors later match using that same exact casing.

MessagePayload

Optional object or body value sent by producer-style endpoints. This is the payload your scenario is actually placing on the wire.

MessagePayloadType

Optional type hint used when JSON selectors need typed parsing. Leave it unset when dynamic JSON parsing is enough.

JsonSettings / JsonConvertSettings

Optional serializer settings for System.Text.Json or Newtonsoft.Json. Use them only when the payload shape or naming strategy requires custom parsing behavior.

ContentType

Optional explicit content type for custom payload handling. This is most helpful for delegate-style transports or non-default HTTP body shapes.

ConnectionString

Required Redis connection string.

StreamKey

Required Redis stream name used for the tracked workflow.

ConsumerGroup

Required for consume mode so Redis can coordinate tracked reads.

ConsumerName

Required for consume mode so each reader inside the consumer group has a stable identity.

StartFromEarliest

Defaults to true. Use it when the run should begin at the start of the stream instead of only new entries.

ReadCount

Batch size for each Redis read operation. It must be greater than zero.

MaxLength

Optional producer-side stream cap. When you set it, the value must be greater than zero.

{ "trackingId": "trk-1", "status": "completed" }