Faulty documentation for application local error handling
As it has been duely documented that groups' error channels are to be accessed by their destination name, it turns out that the provided example is wrong using the channel label: it won't work as expected, intercepting thrown exceptions.
Also the example could rather use ErrorMessage instead of Message> (or maybe Message
see https://docs.spring.io/spring-cloud-stream/docs/current/reference/htmlsingle/#_application_error_handling
You're pointing to very old documentation. Please use - https://cloud.spring.io/spring-cloud-static/spring-cloud-stream/2.2.1.RELEASE/home.html. You can access it from project's website https://spring.io/projects/spring-cloud-stream#learn
Also, note that we're no longer promoting annotation-based configuration model in favor of pure functional approach. You can read more about it in the following sequence of blogs:
- https://spring.io/blog/2019/10/14/spring-cloud-stream-demystified-and-simplified
- https://spring.io/blog/2019/10/17/spring-cloud-stream-functional-and-reactive
- https://spring.io/blog/2019/10/25/spring-cloud-stream-and-spring-integration
- https://spring.io/blog/2019/10/31/spring-cloud-stream-event-routing
Thanks very much for the pointers, I'm currently studying them, trying to convert annotation use cases. As for many Java projects, you cannot expect from the community that older versions won't be used along for while. So I would recommend that documentation errors in such cases be also fixed, in order for in-debt comers to get a proper information. By the way, the current doc is still wrong I guess: https://docs.spring.io/spring-cloud-stream/docs/current/reference/htmlsingle/#_application_error_handling