codecamp

Spring Cloud GCP 发布/订阅操作和模板

PubSubOperations是一种抽象,允许Spring用户使用Google Cloud Pub / Sub,而无需依赖任何Google Cloud Pub / Sub API语义。它提供了与Google Cloud Pub / Sub交互所需的一组通用操作。PubSubTemplatePubSubOperations的默认实现,它使用发布/订阅的 Google Cloud Java客户端 与Google Cloud发布/订阅进行交互。

PubSubTemplate取决于PublisherFactorySubscriberFactoryPublisherFactory为发布/订阅Publisher提供了Google Cloud Java客户端。 SubscriberFactory为异步消息提取提供Subscriber,为同步提取提供SubscriberStub适用于GCP Pub / Sub的Spring Boot入门程序使用默认设置自动配置PublisherFactorySubscriberFactory,并使用Spring Boot GCP入门程序自动配置的GcpProjectIdProviderCredentialsProvider

Spring Cloud GCP Pub / Sub DefaultPublisherFactory提供的PublisherFactory实现按主题名称缓存Publisher实例,以优化资源利用率。

PubSubOperations接口实际上是PubSubPublisherOperationsPubSubSubscriberOperations与相应的PubSubPublisherTemplatePubSubSubscriberTemplate实现的组合,可以单独使用或通过复合PubSubTemplate使用。 该文档的其余部分引用了PubSubTemplate,但同样适用于PubSubPublisherTemplatePubSubSubscriberTemplate,这取决于我们是在谈论发布还是订阅。

Spring Cloud GCP Spring初始化
Spring Cloud GCP 发布到主题
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

三、Spring Cloud Netflix

SpringCloud Hystrix超时和Ribbon客户

SpringCloud 重试失败的请求

五、Spring Cloud Stream

六、SpringCloud Binder实现

SpringCloud 重试RabbitMQ Binder

SpringCloud Dead-Letter队列处理

八、Spring Cloud Sleuth

SpringCloud 当前Span

十二、Spring Cloud for Cloud Foundry

十三、Spring Cloud Contract

Spring Cloud Contract验证程序设置

SrpingCloud Gradle项目

十五、Spring Cloud网关

Spring Cloud 配置路由谓词工厂和网关过滤工厂

Spring Cloud TLS / SSL

Spring Cloud网关配置

SpringCloud 故障排除

十八、Spring Cloud GCP

Spring Cloud GCP Spring资源

Spring Cloud Spring JDBC

Spring Cloud Redis的Cloud Memorystore

Spring Cloud 云身份识别代理(IAP)身份验证

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }