Crates.io | tempest-source-redis |
lib.rs | tempest-source-redis |
version | 0.1.1 |
source | src |
created_at | 2019-08-28 23:34:13.100806 |
updated_at | 2019-09-07 22:57:00.312092 |
description | Tempest source implementation for Redis Streams |
homepage | |
repository | https://github.com/grippy/tempest.git |
max_upload_size | |
id | 160534 |
size | 49,024 |
This library polls for messages from a Redis Streams source.
Cargo.toml
[dependencies]
tempest-source-redis = "0.1.0"
use tempest_source_redis::prelude::*;
// create a type alias to the RedisStreamSourceBuilder
type Source = RedisStreamSourceBuilder<'a>;
// configure a topology with this source
struct MyTopology {}
impl Topology<Source> for MyTopology {
// implementation code here
}
You can configure RedisStreamSource
at runtime by adding this to your Topology configuration file:
[source.config]
# redis connection uri
uri = "redis://127.0.0.1:6379/0"
# redis stream key
key = "some-key"
# redis stream group to use
group = "abc234"
# number of stream messages to read per xreadgroup
read_msg_count = 1000
# time in milliseconds for how often
# to poll for new stream messages
poll_interval = 1
# max poll backoff in milliseconds
max_backoff = 30000
# configure blocking reads
blocking_read = true
# msgid to begin reading from
group_starting_id = "0000"
# how often should the source check for new
# message to batch ack
ack_interval = 100
# ack strategy
ack_policy = { type = "Batch", value = 1000}
ack_policy = { type = "Individual" }
# monitor interval is used to handling messages
# from xpending
monitor_interval = 10000
# actions to take on pending message
pending_handlers = [
{ action = {type = "Delete"}, min_idle_time = 100000, times_delivered = 5},
{ action = {type = "Ack"}, min_idle_time = 10000, times_delivered = 10},
{ action = {type = "Claim"}, min_idle_time = 200000, times_delivered = 1},
]