【问题标题】:Spring Cloud Stream with autoscaling subscribers will it process the same message using cloud pubsub binder?具有自动缩放订阅者的 Spring Cloud Stream 是否会使用云 pubsub binder 处理相同的消息?
【发布时间】:2019-07-25 22:54:02
【问题描述】:

我在 Google Appengine 上有两项服务,它们会随着 2 到 20 个实例的负载增加而自动扩展。我刚刚添加了 spring cloud stream 和 pubsub binder 来发布通信服务订阅的消息。到目前为止它似乎有效,但我一直被质疑当订阅者自动缩放时会发生什么。是否有机会从队列中提取相同的消息?我在文档的属性下看到 https://docs.spring.io/spring-cloud-stream/docs/Elmhurst.SR2/reference/htmlsingle/#_configuration_options 它显示实例计数和实例索引。当实例是短暂的并且从相同的外部配置中读取时,我什至不确定如何设置这些。如果有人遇到这个问题,请告诉我。

【问题讨论】:

    标签: spring stream cloud spring-cloud-stream


    【解决方案1】:

    Google Cloud Pub/Sub 中没有类似 queue 的东西。有一个主题和订阅。因此,如果您的所有订阅者都使用相同的订阅(SCSt 中的消费者组),那么只有一个实例会从主题中获取消息。

    在参考手册中查看更多信息:https://cloud.spring.io/spring-cloud-static/spring-cloud-gcp/1.1.0.RELEASE/multi/multi__spring_cloud_stream.html#_consumer_destination_configuration

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-19
      • 2017-08-23
      • 1970-01-01
      • 2019-10-03
      • 2018-03-09
      • 1970-01-01
      • 2021-06-03
      • 2023-03-29
      相关资源
      最近更新 更多