Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Redis Streams

Publishes to or consumes from a Redis stream (XADD / XREADGROUP). Consumers use a consumer group by default for durable, acked delivery; subscriber_mode=true reads ephemerally via XREAD.

URL format

redis://[user:pass@]host[:port]?stream=<key>

redis:// (plain) and rediss:// (TLS) are both accepted; redis_streams:// is an explicit alias. If stream is omitted it defaults to the route name.

Examples

Load a CSV file into a stream, one-shot:

mq-bridge-app copy --drain \
  --from file:///data/events.csv?format=csv \
  --to redis://localhost:6379?stream=events

Consume with a durable group into ClickHouse, continuous:

mq-bridge-app copy \
  --from 'redis://localhost:6379?stream=events&group=analytics&consumer_name=w1' \
  --to 'clickhouse://localhost:8123?table=events&database=analytics'

Unclaimed entries pending longer than redelivery_timeout_ms (default 60s) are re-delivered via XAUTOCLAIM.

Ephemeral tail of new messages (no group, no acks), continuous:

mq-bridge-app copy \
  --from 'redis://localhost:6379?stream=events&subscriber_mode=true' \
  --to kafka://kafka.local:9092?topic=events

Key options

OptionPurpose
streamStream key to publish to / read from. Defaults to the route name.
groupConsumer-only: group name. Defaults to {APP_NAME}-{stream}.
consumer_nameConsumer-only: consumer within the group.
subscriber_modeConsumer-only: ephemeral XREAD from new messages (no group/acks).
read_from_startConsumer-only: on group creation, start from the beginning (0) not $.
redelivery_timeout_msConsumer-only: re-claim entries pending ≥ this long; 0 disables.
reader_connectionsConsumer-only: parallel XREADGROUP readers across the group.
maxlen + approx_trimPublisher-only: cap stream length with XADD MAXLEN.
username / passwordAuthentication (Redis ACL).

Full field list: reference/redis.md.