Skip to content

Redis Integration

Open Outbox Relay supports Redis Streams as a high-performance, low-latency alternative for event egress. This is ideal for internal microservices communication where Redis is already part of your infrastructure.

To enable the Redis publisher, set the following environment variables.

VariableDescriptionExample
PUBLISHER_TYPEMust be set to redis.redis
PUBLISHER_URLThe Redis connection string (supports redis:// and rediss://).redis://localhost:6379
REDIS_WRITE_TIMEOUTMax time to wait for Redis to acknowledge the write.1s
REDIS_CONNECTION_TIMEOUTMax time to wait for the redis client to connect to the Redis server5s

The Redis publisher uses the XADD command to push events into Streams. Unlike NATS or Kafka, Redis Streams are automatically created upon the first write, so no manual provisioning of streams is required.

The Relay uses the event_type column from your outbox table as the Stream Key. For example:

  • If event_type = openoutbox.events.v1, the data is written to a Redis Stream of the same name.

The Postgres event columns are mapped to Redis hash fields within the stream entry:

Redis FieldDescription
idThe original UUID from the database.
payloadThe event body (JSON or binary).
partition_keyThe key used for consumer-side ordering.
h:*Metadata/Headers are prefixed with h: (e.g., h:trace_id).