-
Notifications
You must be signed in to change notification settings - Fork 0
Examples Custom Executor
synthaicode edited this page Nov 12, 2025
·
1 revision
Purpose: Implement a custom IKsqlExecutor for logging/retry/policy without touching call sites.
- Centralize retries/backoff/circuit-breaker around KSQL calls.
- Inject structured logs/metrics/correlation IDs.
Wrap the default executor and add policies:
public sealed class LoggingRetryExecutor : IKsqlExecutor
{
private readonly IKsqlExecutor _inner;
public LoggingRetryExecutor(IKsqlDbClient client) => _inner = new KsqlExecutor(client);
public async Task<KsqlDbResponse> ExecuteStatementAsync(string statement, CancellationToken ct = default)
{
Console.WriteLine($"[exec] {statement}");
for (var attempt = 1; ; attempt++)
{
try { return await _inner.ExecuteStatementAsync(statement, ct); }
catch when (attempt < 3) { await Task.Delay(TimeSpan.FromMilliseconds(200*attempt), ct); }
}
}
public Task<KsqlDbResponse> ExecuteExplainAsync(string ksql, CancellationToken ct = default)
=> ExecuteStatementAsync($"EXPLAIN {ksql}", ct);
}cd examples/custom-executordotnet run- Output shows retries/log lines and a stubbed KsqlDbResponse
Note: At present, injecting a custom executor into KsqlContext is internal. The example demonstrates policy composition directly with a stub IKsqlDbClient.
Guide
Core Concepts
Tumbling
- Tumbling-Overview
- Tumbling-Definition
- Tumbling-Consumption
- Tumbling-Topics-Config
- Tumbling-State-Store
- Tumbling-Schedule-Last
- Tumbling-Migration
Operations
- Produce-Consume-and-DLQ
- Operations-Startup-and-Monitoring (Index)
- Operations-Startup
- Operations-Startup-Warmup
- Lag-Monitoring-and-Tuning
- Streamiz-Clear
- Appsettings
- Appsettings-Kafka
- Examples
- CLI-Usage
Operations (Runtime)
Reference