Skip to main content
Buffer is a Rust library. Configuration is expressed as plain Rust structs that the host service constructs and hands to the Producer and Consumer APIs. Two top-level structs govern the write and read sides: ProducerConfig and ConsumerConfig. Both share the same ObjectStoreConfig from the common crate. The structs derive Serialize/Deserialize so host services may embed them in their own config formats, but the canonical surface documented here is the Rust API.

ProducerConfig

Controls where data batches and the queue manifest are written, how often batches are flushed, and when backpressure is applied.

ConsumerConfig

Controls where the queue manifest and data batches are read from, and how stale batches are garbage collected.
The grace period prevents the consumer from deleting batches that a producer has just written but not yet enqueued in the manifest.

ObjectStoreConfig

A tagged enum re-exported from the common crate. Three variants are available:

CompressionType

Pairing producers and consumers

A producer and the consumer that drains it must agree on three values:
  • object_store must point at the same bucket or directory.
  • manifest_path must be identical, since it identifies the queue.
  • data_path_prefix must be identical, since the manifest stores batch locations relative to it.
A mismatch on any of these silently routes traffic to a different queue or causes the consumer to fail to fetch batches it sees in the manifest.

Examples