Skip to main content

Crate ruststream_kinesis

Crate ruststream_kinesis 

Source
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: ack marks 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; the DynamoDB store behind the dynamodb-lease feature 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 KinesisPosition repositions it - through the framework’s start_at(..) clause at startup, or the Seekable capability 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§

ConnectedKinesisBroker
The typed witness that connect succeeded: holds the live SDK client directly.
KinesisBroker
An Amazon Kinesis Data Streams broker for the RustStream messaging framework.
KinesisMessage
A record delivered by a KinesisSubscriber.
KinesisPublish
The publish policy for KinesisPublisher: pure declaration, constructible anywhere, paired with the connected broker by the runtime after connect.
KinesisPublisher
Publishes records to Kinesis streams (the destination is the stream name or ARN).
KinesisSeeker
Repositions a KinesisSubscriber while its stream runs; minted by Seekable::seeker.
KinesisStream
A subscription descriptor for one Kinesis stream.
KinesisSubscriber
A subscription to one Kinesis stream; yields KinesisMessages from every owned shard.
LeaseState
The persisted state of one shard’s lease.
MemoryLeaseStore
In-process lease coordination, correct for a single service instance.

Enums§

KinesisError
Errors returned by the Amazon Kinesis Data Streams broker.
KinesisPosition
A position in the stream’s retained log: the whole start vocabulary of this broker, accepted by Seeker::seek and by the start_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§

LeaseStore
Durable coordination for shard leases and checkpoints.

Type Aliases§

LeaseError
The boxed error lease stores report; the crate wraps it with the shard for diagnostics.