Skip to content

Fix RedisStreamListener ignoring endpoint DatabaseId (#2447)#2452

Merged
jeremydmiller merged 1 commit intoJasperFx:mainfrom
BlackChepo:fix/2447-Redis-defaultDatabase
Apr 8, 2026
Merged

Fix RedisStreamListener ignoring endpoint DatabaseId (#2447)#2452
jeremydmiller merged 1 commit intoJasperFx:mainfrom
BlackChepo:fix/2447-Redis-defaultDatabase

Conversation

@BlackChepo
Copy link
Copy Markdown
Contributor

Summary

Fixes #2447RedisStreamListener ignored the configured DatabaseId on RedisStreamEndpoint, causing the consumer loop, ACK, and requeue operations to always target
Redis db0.

Three call sites in RedisStreamListener called _transport.GetDatabase() without passing _endpoint.DatabaseId, falling back to the default database: 0 parameter:

Method Impact
ConsumerLoop XREADGROUP / XAUTOCLAIM ran against db0 — messages on the configured database were never consumed
CompleteAsync XACK went to db0 — acknowledged entries on the wrong database
DeferAsync XACK + XADD (requeue) went to db0 — deferred messages landed on the wrong database

Other methods in the same class (MoveToErrorsAsync, InitializeAsync, MoveScheduledToReadyStreamAsync, DeleteExpiredAsync) already correctly passed database: _endpoint.DatabaseId.

Changes

  • src/Transports/Redis/Wolverine.Redis/Internal/RedisStreamListener.cs — pass database: _endpoint.DatabaseId to the three affected GetDatabase() calls
  • src/Transports/Redis/Wolverine.Redis.Tests/NonDefaultDatabaseTests.cs — regression test that publishes and consumes on databaseId: 1, verifying the listener honors
    non-default databases

Three call sites in RedisStreamListener called GetDatabase() without
passing _endpoint.DatabaseId, causing ConsumerLoop, CompleteAsync, and
DeferAsync to always operate on db0 instead of the configured database.

Add regression test that publishes and consumes on databaseId 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WolverineFx.Redis: Redis Streams listener ignores defaultDatabase and falls back to db0

2 participants