0
votes

I have successfully used Spring Cloud Stream Kafka Binder (org.springframework.cloud:spring-cloud-starter-stream-kafka:3.0.1.RELEASE) and Spring Cloud Azure Event Hubs (com.microsoft.azure:spring-cloud-starter-azure-eventhubs:1.2.3) with Spring Boot 2.2.6 to Publish and Consume messages from Azure Event Hub (with Kafka API enabled).

However, when i try to integrate the same versions of the Spring Cloud libraries with Spring Boot 1.5.22, I am facing the issue java.lang.NoClassDefFoundError: org/springframework/integration/support/converter/ConfigurableCompositeMessageConverter

When i used spring-cloud-starter-stream-kafka:1.3.4.RELEASE and com.microsoft.azure:spring-cloud-starter-azure-eventhubs:1.1.0, I am getting zookeeper connection issues probably due to a different set of properties needed for configuration

2020-04-29 17:01:43.104  INFO 81976 --- [localhost:2181)] [org.apache.zookeeper.ClientCnxn         ] [-] [-] : Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2020-04-29 17:01:43.107  WARN 81976 --- [localhost:2181)] [org.apache.zookeeper.ClientCnxn         ] [-] [-] : Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect

    java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
        at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1141)

My application.yaml looks like below

spring:
  cloud:
    azure:
      auto-create-resources: true
      credential-file-path: my.azureauth
      eventhub:
        checkpoint-storage-account: azuremigrationv2
        namespace: somenamespace
      region: Central US
      resource-group: some-rg
    stream:
      bindings:
        consumer:
          destination: event-hub-1
          group: testconsumergroup
          content-type: application/json
          nativeEncoding: true
          consumer:
            concurrency: 1
            valueSerde: JsonSerde
            requeue-rejected: true

I would like to know which versions of the libraries i am using are compatible with Spring Boot >= 1.5.20

1
Spring Boot 1.5 is EOL and is no longer supported . Also the stream cloud etc. versions compatible with boot 1.5 are no longer supported. Why would you want to go backward?Oleg Zhurakousky

1 Answers

0
votes

My understanding is that config properties within spring.cloud.azure are for the dependency azure-spring-cloud-starter-eventhubs and the config properties within spring.cloud.stream are for use with azure-spring-cloud-stream-binder-eventhubs . I could be wrong about this but I think it is correct. There is no good documentation on it that I could find and it makes things quite confusing if you don't know the difference. It caused me to waste a day or two doing POCs until I started understanding it.

NOTE: When configuring binders, spring.cloud.stream contains spring.cloud.azure subkeys. Link