Skip to content
LoadStrike
Portal

Search LoadStrike

GOOD PLACES TO START

EndpointsCode 56 / 69

Push Diffusion Endpoint

Load test Push Diffusion workflows with LoadStrike using customer-written publish and subscribe callbacks that preserve downstream tracking IDs.

What this page helps you do

What this page helps you do

Load test Push Diffusion workflows with LoadStrike using customer-written publish and subscribe callbacks that preserve downstream tracking IDs.

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 Push Diffusion Endpoint is the source or destination side of the transaction and you need the documented endpoint fields before wiring the scenario.

Visual guide

Custom stream endpoint flow showing publish and observe callbacks around a custom transport.
Custom stream endpoints use publish and consume callbacks so proprietary transports can still feed the same tracking lifecycle.

Guide

When To Use Push Diffusion

Use this endpoint when publish and subscribe behavior should stay inside the normal LoadStrike correlation model, but the integration is delegate-based instead of a built-in protocol adapter.

Implement Real Publish And Subscribe Calls

Your application code supplies the Push Diffusion client, authentication, topic setup and publish or subscribe operations. Replace scaffold callbacks in the examples with real client calls, return the actual publish result, and pass real received messages to the consume callback. A callback that only returns IsSuccess = true sends no message and is not evidence of delivery or downstream completion.

Connection And Tracking

Use the ConnectionProperties dictionary for broker-specific connection metadata and diagnostics that do not have dedicated top-level fields. Tracking still depends on the normal header or body selector contract, so the publish and subscribe sides must preserve the same business identifier.

Measure The Completed Workflow

Select a completion topic emitted after the application performs the business operation, and preserve the source business ID in that result. Keep client connection reuse, subscription readiness, payload size and error handling consistent when increasing load. Compare achieved scenario delivery, correlated completion latency and timeouts; callback success alone does not prove a subscriber received or processed an update.

SDK And Plan Support

Delegate-backed Push Diffusion endpoints are available in C#, Go, Java, Python, TypeScript, and JavaScript on Pro and above with a valid runner key. This is a customer-implemented integration, not a native Push Diffusion adapter; install and configure the appropriate application client separately.

Endpoint definition samples

Use these samples to see how Push Diffusion 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.

Push Diffusion Endpoint

using LoadStrike;

var tracking = new CrossPlatformTrackingConfiguration
{
    Source = new PushDiffusionEndpointDefinition
    {
        Name = "diffusion",
        Mode = TrafficEndpointMode.Produce,
        TrackingField = TrackingFieldSelector.Parse("json:$.trackingId"),
        ServerUrl = "ws://localhost:8080",
        TopicPath = "/orders/in",
        PublishAsync = (request, _) => Task.FromResult(new ProducedMessageResult { IsSuccess = true })
    },
    Destination = new KafkaEndpointDefinition
    {
        Name = "orders-events",
        Mode = TrafficEndpointMode.Consume,
        TrackingField = TrackingFieldSelector.Parse("json:$.trackingId"),
        BootstrapServers = "localhost:9092",
        Topic = "orders.completed",
        ConsumerGroupId = "orders-tests"
    }
};

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

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

Push Diffusion endpoint fields and parameters

ParameterDescription
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.

ServerUrl

Required Push Diffusion server URL.

TopicPath

Required topic path used for publish or subscribe behavior.

Principal / Password

Optional credentials for authenticated Push Diffusion connections.

ConnectionProperties

Optional connection-level dictionary for Push Diffusion-specific connection metadata.

PublishAsync

Required for produce mode. This delegate receives the tracked payload request and must return a ProducedMessageResult.

SubscribeAsync

Required for consume mode. This delegate subscribes and forwards consumed tracked messages back into LoadStrike.