Push Diffusion Endpoint
Track publish and subscribe flows using delegate-based integration.
Delegates
Provide publish and subscribe delegates for custom transport behavior.
Connection Properties
ConnectionProperties dictionary allows custom connection-level metadata for broker-specific options and diagnostics.
Feature Usage Samples
How to use snippets for Push Diffusion 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.
Push Diffusion Endpoint
var endpoint = 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 })
};
import com.loadstrike.runtime.LoadStrikeCorrelation.TrackingFieldSelector;
import com.loadstrike.runtime.LoadStrikeTransports;
import com.loadstrike.runtime.PushDiffusionEndpointDefinition;
var endpoint = new PushDiffusionEndpointDefinition();
endpoint.name = "diffusion";
endpoint.mode = LoadStrikeTransports.TrafficEndpointMode.Produce;
endpoint.trackingField = TrackingFieldSelector.parse("json:$.trackingId");
endpoint.serverUrl = "ws://localhost:8080";
endpoint.topicPath = "/orders/in";
endpoint.publishAsync = request -> {
var result = new LoadStrikeTransports.ProducedMessageResult();
result.isSuccess = true;
return result;
};
from loadstrike_sdk import (
ProducedMessageResult,
PushDiffusionEndpointDefinition,
TrackingFieldSelector,
)
endpoint = PushDiffusionEndpointDefinition(
name="diffusion",
mode="Produce",
tracking_field=TrackingFieldSelector.parse("json:$.trackingId"),
server_url="ws://localhost:8080",
topic_path="/orders/in",
publish_async=lambda request: ProducedMessageResult(is_success=True),
)
import { PushDiffusionEndpointDefinition, TrackingFieldSelector } from "@loadstrike/loadstrike-sdk";
const endpoint = new PushDiffusionEndpointDefinition({
name: "diffusion",
mode: "Produce",
trackingField: TrackingFieldSelector.parse("json:$.trackingId"),
serverUrl: "ws://localhost:8080",
topicPath: "/orders/in",
publishAsync: async () => ({ isSuccess: true })
});
const { PushDiffusionEndpointDefinition, TrackingFieldSelector } = require("@loadstrike/loadstrike-sdk");
const endpoint = new PushDiffusionEndpointDefinition({
name: "diffusion",
mode: "Produce",
trackingField: TrackingFieldSelector.parse("json:$.trackingId"),
serverUrl: "ws://localhost:8080",
topicPath: "/orders/in",
publishAsync: async () => ({ isSuccess: true })
});
Use
Provide the producer callback that sends the message into Push Diffusion using the same request and result contract shape across all supported SDKs.
Provide the consumer callback that listens for destination-side messages using the same message contract shape across all supported SDKs.