Expand description
Amazon Kinesis Data Streams broker implementation for RustStream.
Handlers, routers, codecs, and middleware come from the framework; this crate supplies
the transport over the official aws-sdk-kinesis -
plus the coordination the vendor’s consumer library provides on other platforms and the
Rust SDK does not: shard discovery across splits and merges, shard leasing with fencing,
and per-shard checkpointing.
- Acknowledgement is a checkpoint:
ackmarks a record handled, and the per-shard watermark advances (and persists) once every earlier record is handled too - a checkpoint implies everything before it. An unacknowledged record wedges the watermark, so the shard replays from it when the lease is next taken: at-least-once, always. - Leases live in a pluggable
LeaseStore: the built-in in-process store is correct for a single service instance; theDynamoDBstore behind thedynamodb-leasefeature lets multiple instances share the shards with conditional-write fencing. - Children of a split or merge start only after their parents are fully consumed, which is what keeps per-key ordering across resharding.
- Where a subscription starts is one vocabulary, not two: a shard resumes from its stored
checkpoint and otherwise opens at the tip, and
KinesisPositionrepositions it - through the framework’sstart_at(..)clause at startup, or theSeekablecapability while it runs. - Shared polling only in this release: enhanced fan-out is a different resume machine on an HTTP/2 push stream with no local emulator support, and is deliberately deferred. KPL-aggregated records are refused loudly rather than delivered as opaque protobuf.
Structs§
- Connected
Kinesis Broker - The typed witness that
connectsucceeded: holds the live SDK client directly. - Kinesis
Broker - An Amazon Kinesis Data Streams broker for the
RustStreammessaging framework. - Kinesis
Message - A record delivered by a
KinesisSubscriber. - Kinesis
Publish - The publish policy for
KinesisPublisher: pure declaration, constructible anywhere, paired with the connected broker by the runtime afterconnect. - Kinesis
Publisher - Publishes records to Kinesis streams (the destination is the stream name or ARN).
- Kinesis
Seeker - Repositions a
KinesisSubscriberwhile its stream runs; minted bySeekable::seeker. - Kinesis
Stream - A subscription descriptor for one Kinesis stream.
- Kinesis
Subscriber - A subscription to one Kinesis stream; yields
KinesisMessages from every owned shard. - Lease
State - The persisted state of one shard’s lease.
- Memory
Lease Store - In-process lease coordination, correct for a single service instance.
Enums§
- Kinesis
Error - Errors returned by the Amazon Kinesis Data Streams broker.
- Kinesis
Position - A position in the stream’s retained log: the whole start vocabulary of this broker,
accepted by
Seeker::seekand by thestart_at(..)clause of#[subscriber(..)].
Constants§
- PARTITION_
KEY_ HEADER - Header carrying the partition key, mapped onto the record’s own partition key.
- SEQUENCE_
HEADER - Header exposing the record’s sequence number on received messages.
- SHARD_
END - The checkpoint value marking a shard fully consumed; its children may start.
- SHARD_
HEADER - Header exposing the shard a record arrived on.
Traits§
- Lease
Store - Durable coordination for shard leases and checkpoints.
Type Aliases§
- Lease
Error - The boxed error lease stores report; the crate wraps it with the shard for diagnostics.