1 year ago

#352457

test-img

Rayeesahmed Shaikh

Spring Cloud Stream with Azure EventHubs with TokenCredential

How to use azure TokenCredential with azure-spring-cloud-stream-binder-eventhubs to consume data from eventhubs. The default option is with using a connection string but I don’t have that. I have the client id, client secret, and tenant id, with which we can create a TokenCredential. same method I am using with eventhubs java SDK EventProcessorClient and it works fine. How I can use same with azure-spring-cloud-stream-binder-eventhubs.

I tried any bean we provide or with the properties a given here

https://microsoft.github.io/spring-cloud-azure/4.0.0/reference/html/index.html#eventhubs-connection-configuration

but it is not working. I am getting this error.

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.azure.spring.integration.eventhub.factory.EventHubConnectionStringProvider' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1790) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1385) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) ~[spring-beans-5.3.7.jar:5.3.7]
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[spring-beans-5.3.7.jar:5.3.7]
    ... 44 common frames omitted

spring-cloud-stream

azure-eventhub

0 Answers

Your Answer

Accepted video resources