Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Propagate async publisher Pub/Sub errors into Stream error channel #2501

Open
elefeint opened this issue Aug 26, 2020 · 6 comments
Open

Propagate async publisher Pub/Sub errors into Stream error channel #2501

elefeint opened this issue Aug 26, 2020 · 6 comments
Labels
P2 pubsub GCP PubSub

Comments

@elefeint
Copy link
Contributor

elefeint commented Aug 26, 2020

Per Spring Cloud Stream errorChannelEnabled docs,

if the binder supports asynchroous send results, send failures are sent to an error channel for the destination.

We don't use the errorChannel parameter when creating producer message handler at all right now.

I've clarified the title that this relates to the Publisher errors.

@elefeint elefeint added the pubsub GCP PubSub label Aug 26, 2020
@meltsufin meltsufin added the P1 label Aug 26, 2020
@elefeint elefeint added P2 and removed P1 labels Oct 23, 2020
@dinvlad
Copy link

dinvlad commented Dec 27, 2021

Has this been addressed? In other words, could one add errorChannel handler that will be invoked instead of nacking messages? Thanks

@elefeint
Copy link
Contributor Author

This was done for the subscription side (for a Spring Cloud Stream sink), but not for publishing side (for a Spring Cloud Stream source).

Which one is your usecase?

@dinvlad
Copy link

dinvlad commented Dec 28, 2021

Thanks @elefeint , I've tried this but with a global errorChannel instead and it isn't working for me, for some reason.

@elefeint
Copy link
Contributor Author

@dinvlad Replacing this line with @ServiceActivator(inputChannel = "errorChannel") captures the error for me. There are two things that could be tripping you up:

  1. Spring Cloud Stream won't consider an error handed off to the global error handler "handled", and will propagate an error back to the binder.
  2. If a stream-specific my-topic.my-group.errors has a listener, there is no longer an error to propagate to the global channel; the process completes successfully.

In the future, please create a new issue with any relevant information about what you tried and what the expected outcome was -- this makes it easier for developers to find useful threads in the future.

@elefeint elefeint changed the title Propagate async Pub/Sub errors into Stream error channel Propagate async publisher Pub/Sub errors into Stream error channel Dec 30, 2021
@dinvlad
Copy link

dinvlad commented Jan 1, 2022

OK, thanks for clarifying @elefeint - I was under the impression I could get a global "catch all", but looks like that's not how it works. I'm assuming this behavior is not specific to PubSub?

@elefeint
Copy link
Contributor Author

elefeint commented Jan 4, 2022

Right; this is how Spring Cloud Stream works -- here is a relevant SO explanation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P2 pubsub GCP PubSub
Development

No branches or pull requests

3 participants