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