spring-projects / spring-projects/spring-data-redis

Switch `StreamMessageListenerContainer` default to not unsubscribe on simple exception

Open
#2,919 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

theme: 4.0 type: enhancement
Dominant language
Java
Stars
1.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

While using Redis Stream, I encountered an issue where the consumer faced an exception while consuming, leading to the cancellation of subscription by the StreamMessageListenerContainer. I found that this was due to cancelSubscriptionOnError being triggered when encountering an exception. However, StreamReadRequest is package-private, so I have no way to modify cancelSubscriptionOnError. I'd like to inquire about how to handle consumer exceptions during consumption to maintain the subscription intact.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with StreamMessageListenerContainer and the package-private StreamReadRequest, then trace how cancelSubscriptionOnError handles consumer exceptions. The change is complete when a simple consumption exception no longer cancels the subscription by default; the payload does not name a test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, redis
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.