我找到了三种使用Google Pub Sub实现消息传递的方式:
我需要实现单个Topic和单个Subscription以获取队列功能。如果不需要,我认为最好不使用Spring message channels,因为它们似乎会在Pub Sub主题和订阅之间中介通信,而我不希望出现这种情况。我想简单处理,所以我认为选项3可能是最佳选择,但我也想知道选项1。
使用Spring Integration消息通道和PubSubTemplate API https://dzone.com/articles/spring-boot-and-gcp-cloud-pubsub
使用PubSubTemplate API但不使用消息通道 https://medium.com/bb-tutorials-and-thoughts/gcp-how-to-subscribe-and-send-pubsub-messages-in-spring-boot-app-b27e2e8863e3
我需要实现单个Topic和单个Subscription以获取队列功能。如果不需要,我认为最好不使用Spring message channels,因为它们似乎会在Pub Sub主题和订阅之间中介通信,而我不希望出现这种情况。我想简单处理,所以我认为选项3可能是最佳选择,但我也想知道选项1。