Spring Cloud 集成 Azure Eventhub

本文档介绍了如何将Spring Cloud应用程序与Azure China的Eventhub服务集成。在官方文档和示例代码的基础上,由于默认配置适用于Azure Global,针对Azure China的资源需要进行调整。通过修改maven依赖和创建特定Bean来切换到Azure China环境,实践证明这种方法有效。
摘要由CSDN通过智能技术生成

https://docs.microsoft.com/en-us/java/azure/spring-framework/configure-spring-cloud-stream-binder-java-app-azure-event-hub?view=azure-java-stable
https://github.com/microsoft/spring-cloud-azure/tree/master/spring-cloud-azure-samples/eventhubs-operation-sample
以上链接为SpringCloud集成eventhub的文档和代码,由于默认是针对Azure Globle的Eventhub服务,如果要使用Azure China的相关资源,需要稍作修改

  • maven依赖
<dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>azure-spring-boot-starter</artifactId>
    <version>${azure.version}</version>
</dependency>
<dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>spring-cloud-starter-azure-eventhub</artifactId>
    <version>1.1.0.RC1</version>
</dependency>
  • application.properties配置
azure.storage.connection-string=xxx

# Fill event hub namespa
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值