Expand description
Connector-framework SPI for Crabka.
This crate defines the keystone traits that every connector — every CDC source, every telemetry sink — builds on, plus the converter layer that bridges typed payloads to the Kafka wire.
-
Sourcepulls records out of an external system one at a time (poll), snapshots its read position (checkpoint), and restores it on restart (seek). Sources can optionally acknowledge a persisted checkpoint after sink commit withacknowledge. -
Sinkpushes records into an external system in batches (put), makes them durable (flush), and optionally gates writes behind a transaction for exactly-once delivery (begin/commit/abort). -
Converterbridges a connector’s typed payloadTto and from wirebytes::Bytes.ByteIdentityis a byte-for-byte passthrough;SchemaConverterwraps the Confluent schema-registry serdes fromcrabka-schema-serde. -
ConnectorRuntimeis the embeddable, single-process driver that owns aSource+Sinkpair and pipes records between them — polling, applying bounded backpressure, coordinating source checkpoints with sink commits through the transactional gate, and exposing pause/resume + graceful-drain lifecycle hooks. No Connect worker protocol, no REST.
The transport traits mirror the streams runtime I/O traits
(RecordFetcher / RecordProducer) and the remote-storage
RemoteStorageManager SPI; the converter layer mirrors Kafka Connect’s
Converter. All records carry an optional key, optional value (a None
value is a tombstone), an optional timestamp, and ordered headers — see
ConnectRecord.
Re-exports§
pub use config::ConfigDef;pub use config::ConfigError;pub use config::ConfigKey;pub use config::ConfigKind;pub use config::ConfigResult;pub use config::ConnectorConfig;pub use config::EnvSecretResolver;pub use config::FromResolvedValue;pub use config::RawConfig;pub use config::ResolveOptions;pub use config::ResolvedConfig;pub use config::SecretRef;pub use config::SecretResolutionError;pub use config::SecretResolver;pub use config::SecretString;pub use convert::ByteIdentity;pub use convert::Converter;pub use convert::SchemaConverter;pub use error::ConnectError;pub use ids::PartitionMap;pub use ids::PositionMap;pub use record::ConnectRecord;pub use record::Header;pub use record::OffsetMap;pub use record::OffsetValue;pub use record::SourceOffset;pub use runtime::CheckpointStore;pub use runtime::ConnectorHandle;pub use runtime::ConnectorRuntime;pub use runtime::HasSink;pub use runtime::HasSource;pub use runtime::InMemoryCheckpointStore;pub use runtime::NoSink;pub use runtime::NoSource;pub use runtime::RuntimeState;pub use sink::Sink;pub use source::Source;
Modules§
- config
- Connector configuration definitions, validation, and secret resolution.
- convert
- The converter layer: bridge a connector’s typed payload
Tto and from the rawBytesthat travel on the Kafka wire. - error
- The error type shared by the connector SPI.
- ids
- Newtypes over the connector-offset maps.
- record
- The record and offset types that flow across the connector SPI.
- runtime
- The
ConnectorRuntime: an async driver that owns oneSourceand oneSinkand pipes records between them in a single process — no Connect worker protocol, no REST, no broker required between the two ends. This is the embeddable, single-binary shape (a ground-station / aircraft edge box): build it programmatically,runit, and drive its lifecycle through the returnedConnectorHandle. - sink
- The
SinkSPI: push records into an external system, with an optional transactional write gate for exactly-once delivery. - source
- The
SourceSPI: pull records out of an external system, with a checkpointable read position.