pub struct RuntimeConfig {
pub source: RuntimeSourceConfig,
pub snapshot_tables: Vec<String>,
pub incremental_snapshot: Option<IncrementalSnapshotConfig>,
pub checkpoint: Box<dyn Checkpoint>,
pub schema_history: Box<dyn SchemaHistory>,
pub options: RuntimeOptions,
}Expand description
Runtime configuration for embedded execution.
Fields§
§source: RuntimeSourceConfigSource configuration used by the runtime.
snapshot_tables: Vec<String>Snapshot table list used on first run when no checkpoint exists.
incremental_snapshot: Option<IncrementalSnapshotConfig>Optional incremental (non-blocking) snapshot configuration.
When set, runtime startup initializes stream ingestion through the connector’s watermark-based incremental snapshot handle instead of the classic snapshot + handoff path.
checkpoint: Box<dyn Checkpoint>Checkpoint backend owned by the runtime.
schema_history: Box<dyn SchemaHistory>Schema history backend owned by the runtime.
options: RuntimeOptionsExplicit runtime options including observability and tuning defaults.
Implementations§
Source§impl RuntimeConfig
impl RuntimeConfig
Sourcepub fn new<C, H>(
source: RuntimeSourceConfig,
checkpoint: C,
schema_history: H,
) -> Selfwhere
C: Checkpoint + 'static,
H: SchemaHistory + 'static,
pub fn new<C, H>(
source: RuntimeSourceConfig,
checkpoint: C,
schema_history: H,
) -> Selfwhere
C: Checkpoint + 'static,
H: SchemaHistory + 'static,
Create a config boxing the provided checkpoint and schema history implementations.
Sourcepub fn with_options(self, options: RuntimeOptions) -> Self
pub fn with_options(self, options: RuntimeOptions) -> Self
Replace the full runtime options surface.
Sourcepub fn with_observability(self, observability: RuntimeObservability) -> Self
pub fn with_observability(self, observability: RuntimeObservability) -> Self
Replace the observability configuration.
Sourcepub fn with_metrics(self, metrics: Arc<dyn MetricsCollector>) -> Self
pub fn with_metrics(self, metrics: Arc<dyn MetricsCollector>) -> Self
Override the metrics collector.
Sourcepub fn with_tracer(self, tracer: Arc<dyn EventTracer>) -> Self
pub fn with_tracer(self, tracer: Arc<dyn EventTracer>) -> Self
Override the tracer.
Sourcepub fn with_max_buffer_size(self, max_buffer_size: usize) -> Self
pub fn with_max_buffer_size(self, max_buffer_size: usize) -> Self
Override the maximum buffer size.
Sourcepub fn with_max_poll_wait_ms(self, max_poll_wait_ms: u64) -> Self
pub fn with_max_poll_wait_ms(self, max_poll_wait_ms: u64) -> Self
Override the poll wait budget in milliseconds.
Sourcepub fn with_transform_error_policy(self, policy: TransformErrorPolicy) -> Self
pub fn with_transform_error_policy(self, policy: TransformErrorPolicy) -> Self
Configure transform failure behavior. Defaults to TransformErrorPolicy::Halt.
§Operational Guidance
- Production: Use
Halt(default) to fail fast on data corruption. - Staging/Testing: Use
Skipfor tolerant evaluation (e.g., optional enrichment). - Change at Runtime: Policy is set at config time; to change behavior, recreate runtime.
§Error Context
Errors during transform execution include the transform’s name and the event ID, enabling quick diagnosis. All failed events are logged regardless of policy.
Sourcepub fn with_post_commit_source_confirm_policy(
self,
policy: PostCommitSourceConfirmPolicy,
) -> Self
pub fn with_post_commit_source_confirm_policy( self, policy: PostCommitSourceConfirmPolicy, ) -> Self
Configure post-commit source confirmation behavior.
Sourcepub fn with_idempotency(self, idempotency: IdempotencyOptions) -> Self
pub fn with_idempotency(self, idempotency: IdempotencyOptions) -> Self
Configure runtime-level idempotency guard options.
Duplicate detection runs before transform stages, so dedupe decisions are stable even when downstream transforms are nondeterministic.
Sourcepub fn with_idempotency_disabled(self) -> Self
pub fn with_idempotency_disabled(self) -> Self
Explicitly disable runtime-level duplicate suppression.
Sourcepub fn with_event_validation(self, enabled: bool) -> Self
pub fn with_event_validation(self, enabled: bool) -> Self
Enable or disable canonical event-envelope validation at runtime ingress.
Sourcepub fn with_schema_history_retention(
self,
retention: SchemaHistoryRetention,
) -> Self
pub fn with_schema_history_retention( self, retention: SchemaHistoryRetention, ) -> Self
Configure runtime-managed schema-history retention after DDL persistence.
Sourcepub fn with_snapshot_tables(self, snapshot_tables: Vec<String>) -> Self
pub fn with_snapshot_tables(self, snapshot_tables: Vec<String>) -> Self
Configure snapshot tables for initial snapshot mode.
Sourcepub fn with_incremental_snapshot(
self,
config: IncrementalSnapshotConfig,
) -> Self
pub fn with_incremental_snapshot( self, config: IncrementalSnapshotConfig, ) -> Self
Configure runtime startup to use incremental (non-blocking) snapshot mode.
This supersedes the classic with_snapshot_tables bootstrapping path.
Do not set both at once.