使用 Spring Cloud Stream Kafka 实现函数绑定过程/消费的断路器
这是我的示例流程并使用我在应用程序的函数绑定中设置的 bean
我想要向这些函数添加断路器,但它不会工作,因为这些 bean 只是在项目构建期间被读取。目标是:我希望我的断路器能够捕获在从 kafka 主题获取消息之前在流中遇到的所有异常。示例异常(当卡夫卡关闭时,反序列化)我想在断路器中捕获所有异常,以便我可以在电路打开时暂停/启动卡夫卡。
顺便说一句,我已经在我的服务层(业务逻辑将发生的部分)上实现了它。但这仅限于我的服务上的异常,并且无法捕获流中的所有异常。
我正在使用和需要使用的断路器来自 spring.retry。
Here is my sample process and consume bean which I have set in function binding in application
I would like to add a circuit breaker to these functions but it won't work since these beans are just being read during project build. Goal is: I would like my circuit breaker to capture all exceptions that will be encountered during the stream before I get the message from kafka topic. sample exceptions(when kafka is down, deserialization) I would like to capture all of them in circuit breaker so I can pause/start kafka when circuit is open.
Btw, I have already implemented it on my service layer the part where business logic will occur. But that is only limited to the exceptions on my service and won't be able to capture all the exceptions in the stream.
The circuit breaker I'm using and needed to use is from spring.retry.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论