Skip to content

Add batch listener support for Redis StreamMessageListenerContainer.#3334

Open
wwan13 wants to merge 1 commit intospring-projects:mainfrom
wwan13:add-batch-stream-listener
Open

Add batch listener support for Redis StreamMessageListenerContainer.#3334
wwan13 wants to merge 1 commit intospring-projects:mainfrom
wwan13:add-batch-stream-listener

Conversation

@wwan13
Copy link

@wwan13 wwan13 commented Mar 19, 2026

This PR introduces batch listener support for Redis StreamMessageListenerContainer.

Currently, records are delivered individually through StreamListener even when multiple records are returned from Redis using COUNT. This PR adds a BatchStreamListener abstraction to allow processing multiple records in a single callback.

New APIs (registerBatch, receiveBatch) are introduced to support batch consumption while keeping the existing StreamListener API unchanged for backward compatibility.

Batch processing advances the read offset only after successful listener invocation. In case of failures, records may be redelivered, avoiding message loss.

Closes #3190

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding batch support for Redis stream listener containers

2 participants