pub struct PlatformSourceConfig {
pub redis_url: String,
pub stream_key: String,
pub consumer_group: String,
pub consumer_name: Option<String>,
pub batch_size: usize,
pub block_ms: u64,
}Expand description
Platform source configuration for Redis Streams consumption.
This configuration defines how the platform source connects to Redis and consumes events from a stream using consumer groups.
§Example
use drasi_source_platform::PlatformSourceConfig;
let config = PlatformSourceConfig {
redis_url: "redis://localhost:6379".to_string(),
stream_key: "my-app-changes".to_string(),
consumer_group: "my-consumers".to_string(),
consumer_name: Some("consumer-1".to_string()),
batch_size: 50,
block_ms: 10000,
};§YAML Configuration
source_type: platform
properties:
redis_url: "redis://localhost:6379"
stream_key: "my-app-changes"
consumer_group: "my-consumers"
batch_size: 50
block_ms: 10000Fields§
§redis_url: StringRedis connection URL.
Standard Redis connection string format.
§Examples
redis://localhost:6379- Local Redis without authredis://:password@host:6379- Redis with passwordredis://user:password@host:6379- Redis with username and passwordrediss://host:6379- Redis with TLS
stream_key: StringRedis stream key to consume from.
This is the name of the Redis stream that contains the CloudEvent-wrapped change events. The stream must exist or will be created automatically when the consumer group is created with MKSTREAM.
consumer_group: StringConsumer group name.
All source instances with the same consumer group share the workload. Each message is delivered to only one consumer in the group.
Default: "drasi-core"
consumer_name: Option<String>Consumer name (unique within group).
Identifies this specific consumer instance within the consumer group. If not specified, a unique name is auto-generated based on the source ID.
Default: Auto-generated from source ID
batch_size: usizeNumber of events to read per XREADGROUP call.
Higher values improve throughput but increase memory usage and may delay processing of individual events.
Default: 100
Valid range: 1-10000 (recommended)
block_ms: u64Milliseconds to block waiting for new events.
When no events are available, the consumer blocks for this duration before returning an empty result. Higher values reduce CPU usage but increase latency for detecting source shutdown.
Default: 5000 (5 seconds)
Valid range: 100-60000 (recommended)
Implementations§
Trait Implementations§
Source§impl Clone for PlatformSourceConfig
impl Clone for PlatformSourceConfig
Source§fn clone(&self) -> PlatformSourceConfig
fn clone(&self) -> PlatformSourceConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more