春季云功能GCP不包括春季云流的pubsub

发布于 2025-01-18 04:01:15 字数 762 浏览 3 评论 0原文

我在同一项目中将GCP的春季云功能和春季云流组合在一起。 我有一个函数,这是我属性中定义的GCP CF的入口点 spring.cloud.function.definition = gcpfunction

i通过StreamBridge桥接弹簧云流绑定功能的结果。

出乎意料的是,春季云流也会自动绑定gcpfunction函数,并在PubSub中创建一个不必要的主题。我想将功能从春季云流的自动绑定中排除。 我发现唯一的解决方法是将弹簧云功能明确绑定到没有现有函数,例如spring.cloud.stream.function.definition = donotbindfunction

这不是理想的选择而且看起来有些骇人听闻。 还有其他建议的解决方案吗?

我查看了以下主题,但似乎他们并没有真正解决许多问题是否可以禁用Spring-Cloud-stream的功能绑定,以限制特定方法? AS @springbootapplication(dubl = context functionCatalogautoconFiguration.class)disables也为我的gcpfunction进行配置。

I combine both Spring Cloud Function for GCP and Spring Cloud Stream for PubSub in the same project.
I have one function which is an entrypoint for GCP CF defined in my properties
spring.cloud.function.definition=gcpFunction

I bridge the result of the function with Spring Cloud Stream binding by StreamBridge.

Unexpectedly Spring Cloud Stream also automatically binds the gcpFunction function and creates an unwanted topic in PubSub. I would like to exclude the function from the automatic binding for Spring Cloud Stream.
The only workaround I found is to bind Spring Cloud Function explicitly to none existing function e.g. spring.cloud.stream.function.definition=doNotBindFunction

This is not ideal because Spring during startup prints some warnings about a missing function and also looks a bit hacky.
Is there any other recommended solution?

I looked at the following topics but seems like they don't really solve many problem Is it possible to disable spring-cloud-stream's functional binding for a specific method?
as @SpringBootApplication(exclude = ContextFunctionCatalogAutoConfiguration.class) disables also configuration for my gcpFunction

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

酒浓于脸红 2025-01-25 04:01:15

尝试设置spring.cloud.stream.function.autectect = false。这将关闭功能性豆的自动发现( refdoc )。

Try setting spring.cloud.stream.function.autodetect=false. This will turn off autodiscovery of functional beans (refdoc).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文