crabka-connect
The connector-framework SPI for Crabka: the keystone traits every CDC source and telemetry sink builds on.
Source<K, V>— pull records out of an external system one at a time (poll), snapshot the read position (checkpoint), and restore it on restart (seek).Sink<K, V>— push records into an external system in batches (put), durably commit them (flush), and optionally gate writes behind a transaction for exactly-once delivery (begin/commit/abort).Converter<T>— bridge a connector's typed payloadTto and from the rawBytesthat travel on the Kafka wire. Ships with [ByteIdentity] (byte-for-byte passthrough) and [SchemaConverter] (Confluent schema-registry serdes viacrabka-schema-serde).ConnectorRuntime— the embeddable, single-process driver that owns aSource+Sinkpair and pipes records between them. It polls into bounded batches (backpressure), brackets each non-empty commit in the sink's transactional gate (lazybegin→put→commit), and advances the source checkpoint only after the sink commit is durable. Built programmatically —ConnectorRuntime::new().add_source(…).add_sink(…).run()— and driven through aConnectorHandle(pause/resume/ gracefulshutdown). No Connect worker protocol, no REST: the single-binary edge shape.
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.
Connector configuration
Connector implementations can declare a ConfigDef-style schema and derive typed
config extraction. This example uses serde_json to build raw JSON config, so
consumers using this style should add serde_json = "1" as a direct
dependency.
use ;
use json;
async
Secret fields resolve through SecretResolver implementations and are redacted
by Debug and Display.