[英]Concurrency settings for Spring Cloud Stream consumer with GCP pubsub
[英]Spring Cloud Function GCP exclude for Spring Cloud Stream for PubSub
我在同一個項目中將 GCP 的 Spring Cloud Function 和 PubSub 的 Spring Cloud Stream 組合在一起。 我有一個 function,它是在我的屬性spring.cloud.function.definition=gcpFunction
中定義的 GCP CF 的入口點
我通過 StreamBridge 將 function 的結果與 Spring Cloud Stream 綁定橋接。
沒想到 Spring Cloud Stream 也自動綁定了gcpFunction
function 並在 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 eg spring.cloud.stream.function.definition=doNotBindFunction
這並不理想,因為 Spring 在啟動期間會打印一些關於缺少 function 的警告,而且看起來也有點老套。 還有其他推薦的解決方案嗎?
我查看了以下主題,但似乎並沒有真正解決很多問題是否可以針對特定方法禁用 spring-cloud-stream 的功能綁定? 因為 @SpringBootApplication(exclude = ContextFunctionCatalogAutoConfiguration.class) 也禁用了我的gcpFunction
配置
嘗試設置spring.cloud.stream.function.autodetect=false
。 這將關閉功能 bean ( refdoc ) 的自動發現。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.