Transaction-Based Vs Endpoint-Only Testing
Compare endpoint-only testing with full transaction testing so you can measure the whole downstream workflow instead of just the first request.
Guide
Endpoint-Only Testing
Endpoint tests focus on whether one request returns and how quickly it does so. That is useful for isolated services, but it often stops before the business workflow is actually finished.
Transaction-Based Testing
Transaction testing follows the workflow across systems, matches the source and destination events, and reports the latency, timeout, duplicate, and failure behavior of the full path.
Practical Difference
In distributed systems, the real problem often appears after the first hop: queues back up, consumers slow down, retries rise, or orchestration breaks. Transaction-based testing exposes those downstream failures, while endpoint-only testing can leave them hidden.
Feature Usage Samples
Licensing note: every runnable sample still needs a valid runner key. Set it with WithRunnerKey("...") or the config key LoadStrike:RunnerKey before you run the test.
Transaction Model
using LoadStrike;
var source = new HttpEndpointDefinition
{
Name = "orders-api",
Mode = TrafficEndpointMode.Produce,
TrackingField = TrackingFieldSelector.Parse("header:X-Correlation-Id"),
Url = "https://api.example.com/orders",
Method = "POST",
MessagePayload = new { orderId = "ord-1001", amount = 49.95m }
};
var destination = new KafkaEndpointDefinition
{
Name = "orders-completed",
Mode = TrafficEndpointMode.Consume,
TrackingField = TrackingFieldSelector.Parse("header:X-Correlation-Id"),
BootstrapServers = "localhost:9092",
Topic = "orders.completed",
ConsumerGroupId = "loadstrike-orders"
};
var tracking = new CrossPlatformTrackingConfiguration
{
Source = source,
Destination = destination,
RunMode = TrackingRunMode.GenerateAndCorrelate,
CorrelationTimeout = TimeSpan.FromSeconds(30)
};
var scenario = CrossPlatformScenarioConfigurator
.Configure(LoadStrikeScenario.Empty("orders-http-to-kafka"), tracking)
.WithLoadSimulations(
LoadStrikeSimulation.Inject(10, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(20))
);
LoadStrikeRunner.RegisterScenarios(scenario)
.WithRunnerKey("rkl_your_local_runner_key")
.Run();
import com.loadstrike.runtime.CrossPlatformScenarioConfigurator;
import com.loadstrike.runtime.CrossPlatformTrackingConfiguration;
import com.loadstrike.runtime.HttpEndpointDefinition;
import com.loadstrike.runtime.KafkaEndpointDefinition;
import com.loadstrike.runtime.LoadStrikeRuntime.LoadStrikeRunner;
import com.loadstrike.runtime.LoadStrikeRuntime.LoadStrikeScenario;
import com.loadstrike.runtime.LoadStrikeRuntime.LoadStrikeSimulation;
import com.loadstrike.runtime.LoadStrikeCorrelation.TrackingFieldSelector;
import com.loadstrike.runtime.LoadStrikeTransports;
var source = new HttpEndpointDefinition();
source.name = "orders-api";
source.mode = LoadStrikeTransports.TrafficEndpointMode.Produce;
source.trackingField = TrackingFieldSelector.parse("header:X-Correlation-Id");
source.url = "https://api.example.com/orders";
source.method = "POST";
source.messagePayload = java.util.Map.of("orderId", "ord-1001", "amount", 49.95);
var destination = new KafkaEndpointDefinition();
destination.name = "orders-completed";
destination.mode = LoadStrikeTransports.TrafficEndpointMode.Consume;
destination.trackingField = TrackingFieldSelector.parse("header:X-Correlation-Id");
destination.bootstrapServers = "localhost:9092";
destination.topic = "orders.completed";
destination.consumerGroupId = "loadstrike-orders";
var tracking = new CrossPlatformTrackingConfiguration();
tracking.source = source;
tracking.destination = destination;
tracking.runMode = LoadStrikeTransports.TrackingRunMode.GenerateAndCorrelate;
tracking.correlationTimeoutSeconds = 30d;
var scenario = CrossPlatformScenarioConfigurator.Configure(
LoadStrikeScenario.empty("orders-http-to-kafka"),
tracking
).withLoadSimulations(LoadStrikeSimulation.inject(10, 1d, 20d));
LoadStrikeRunner
.registerScenarios(scenario)
.withRunnerKey("rkl_your_local_runner_key")
.run();
from loadstrike_sdk import (
CrossPlatformScenarioConfigurator,
LoadStrikeRunner,
LoadStrikeScenario,
LoadStrikeSimulation,
)
tracking = {
"RunMode": "GenerateAndCorrelate",
"CorrelationTimeoutSeconds": 30,
"Source": {
"Kind": "Http",
"Name": "orders-api",
"Mode": "Produce",
"TrackingField": "header:X-Correlation-Id",
"Url": "https://api.example.com/orders",
"Method": "POST",
"MessagePayload": {"orderId": "ord-1001", "amount": 49.95},
},
"Destination": {
"Kind": "Kafka",
"Name": "orders-completed",
"Mode": "Consume",
"TrackingField": "header:X-Correlation-Id",
"BootstrapServers": "localhost:9092",
"Topic": "orders.completed",
"ConsumerGroupId": "loadstrike-orders",
},
}
scenario = (
CrossPlatformScenarioConfigurator.Configure(
LoadStrikeScenario.empty("orders-http-to-kafka"),
tracking,
)
.with_load_simulations(LoadStrikeSimulation.inject(10, 1, 20))
)
LoadStrikeRunner.register_scenarios(scenario) \
.with_runner_key("rkl_your_local_runner_key") \
.run()
import {
CrossPlatformScenarioConfigurator,
LoadStrikeRunner,
LoadStrikeScenario,
LoadStrikeSimulation,
TrackingFieldSelector
} from "@loadstrike/loadstrike-sdk";
const tracking = {
RunMode: "GenerateAndCorrelate",
CorrelationTimeoutSeconds: 30,
Source: {
Kind: "Http",
Name: "orders-api",
Mode: "Produce",
TrackingField: new TrackingFieldSelector("Header", "X-Correlation-Id"),
Url: "https://api.example.com/orders",
Method: "POST",
MessagePayload: { orderId: "ord-1001", amount: 49.95 }
},
Destination: {
Kind: "Kafka",
Name: "orders-completed",
Mode: "Consume",
TrackingField: new TrackingFieldSelector("Header", "X-Correlation-Id"),
BootstrapServers: "localhost:9092",
Topic: "orders.completed",
ConsumerGroupId: "loadstrike-orders"
}
};
const scenario = CrossPlatformScenarioConfigurator
.Configure(LoadStrikeScenario.empty("orders-http-to-kafka"), tracking)
.withLoadSimulations(LoadStrikeSimulation.inject(10, 1, 20));
await LoadStrikeRunner
.registerScenarios(scenario)
.withRunnerKey("rkl_your_local_runner_key")
.run();
const {
CrossPlatformScenarioConfigurator,
LoadStrikeRunner,
LoadStrikeScenario,
LoadStrikeSimulation,
TrackingFieldSelector
} = require("@loadstrike/loadstrike-sdk");
(async () => {
const tracking = {
RunMode: "GenerateAndCorrelate",
CorrelationTimeoutSeconds: 30,
Source: {
Kind: "Http",
Name: "orders-api",
Mode: "Produce",
TrackingField: new TrackingFieldSelector("Header", "X-Correlation-Id"),
Url: "https://api.example.com/orders",
Method: "POST",
MessagePayload: { orderId: "ord-1001", amount: 49.95 }
},
Destination: {
Kind: "Kafka",
Name: "orders-completed",
Mode: "Consume",
TrackingField: new TrackingFieldSelector("Header", "X-Correlation-Id"),
BootstrapServers: "localhost:9092",
Topic: "orders.completed",
ConsumerGroupId: "loadstrike-orders"
}
};
const scenario = CrossPlatformScenarioConfigurator
.Configure(LoadStrikeScenario.empty("orders-http-to-kafka"), tracking)
.withLoadSimulations(LoadStrikeSimulation.inject(10, 1, 20));
await LoadStrikeRunner
.registerScenarios(scenario)
.withRunnerKey("rkl_your_local_runner_key")
.run();
})();
Comparison
Measures whether one request path responded and how long it took.
Measures whether the workflow completed across the systems that actually deliver the business outcome.
Captures timeout, duplicate, grouped percentile, and downstream failure behavior that endpoint-only tests can miss.