Skip to content

feat: Handle errors on a consume task in the subscriber - #2947

Closed
pbonneaudiabolocom wants to merge 0 commit into
ag2ai:mainfrom
pbonneaudiabolocom:handle-consume-error-in-subscriber
Closed

pbonneaudiabolocom wants to merge 0 commit into
ag2ai:mainfrom
pbonneaudiabolocom:handle-consume-error-in-subscriber

Conversation

@pbonneaudiabolocom

@pbonneaudiabolocom pbonneaudiabolocom commented Jul 20, 2026 •

Copy link
Copy Markdown

…sk in the subscriber.

Description

Whene a consume task fails, we can now adapt the behaviour of the system by overloading _handle_task_exception

Fixes #2945

Type of change

Please delete options that are not relevant.

  • Documentation (typos, code examples, or any documentation updates)
  • Bug fix (a non-breaking change that resolves an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a fix or feature that would disrupt existing functionality)
  • This change requires a documentation update

Checklist

  • My code adheres to the style guidelines of this project (just lint shows no errors)
  • I have conducted a self-review of my own code
  • I have made the necessary changes to the documentation
  • My changes do not generate any new warnings
  • I have added tests to validate the effectiveness of my fix or the functionality of my new feature
  • Both new and existing unit tests pass successfully on my local environment by running just test-coverage
  • I have ensured that static analysis tests are passing by running just static-analysis
  • I have included code examples to illustrate the modifications

@pbonneaudiabolocom
pbonneaudiabolocom marked this pull request as draft July 20, 2026 12:55
@github-actions github-actions Bot added documentation Improvements or additions to documentation Redis Issues related to `faststream.redis` module and Redis features labels Jul 20, 2026
@pbonneaudiabolocom
pbonneaudiabolocom marked this pull request as ready for review July 20, 2026 13:00
@pbonneaudiabolocom pbonneaudiabolocom changed the title feat: create a way method that allow to handle errors on a consume ta… feat: create a way that allow to handle errors on a consume task... Jul 21, 2026
@pbonneaudiabolocom

Copy link
Copy Markdown
Author

@powersemmi that should fix the usage of the exception you raised when no group error is happennning. Any feedback on it ?

@Lancetnik
Lancetnik requested a review from powersemmi July 29, 2026 18:33
@pbonneaudiabolocom
pbonneaudiabolocom force-pushed the handle-consume-error-in-subscriber branch 2 times, most recently from e4f50e5 to 2258f50 Compare August 18, 2026 09:59
@pbonneaudiabolocom pbonneaudiabolocom changed the title feat: create a way that allow to handle errors on a consume task... feat: Handle errors on a consume task in the subscriber Aug 18, 2026

@IvanKirpichnikov IvanKirpichnikov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi. I don’t like the design of your feature. You need to use MethodType, you need to replace the method with another method, you need to override a private method. It looks very strange.

@pbonneaudiabolocom

Copy link
Copy Markdown
Author

I agree that overriding private method is not great.
Maybe I could do some kind of public hook method instead...

People would overload the subscriber and implement their own task_exception_hook method.

Might be easier to do... not sure it will work the same way.

@pbonneaudiabolocom
pbonneaudiabolocom force-pushed the handle-consume-error-in-subscriber branch from 2258f50 to fa474ef Compare September 4, 2026 10:03
@pbonneaudiabolocom
pbonneaudiabolocom force-pushed the handle-consume-error-in-subscriber branch from fa474ef to 1ce2d1d Compare September 4, 2026 10:04
@pbonneaudiabolocom

Copy link
Copy Markdown
Author

I closed that PR by mistake while removing the problematic code.

I openned a new one here, much cleaner I would say.
#3095

I'll tag you thre on it to get your feedbacks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation Redis Issues related to `faststream.redis` module and Redis features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: group removal handling in Redis Stream not functional

2 participants