I am getting error while connecting to kafka..Below are some lines of error
It is an spring boot application
2024-02-21T14:02:03.419Z INFO 1 --- [customer-master-service] [ main] [ ] o.a.k.clients.consumer.KafkaConsumer : [Consumer clientId=consumer-customer-master-service-kafka-group-6, groupId=customer-master-service-kafka-group] Subscribed to topic(s): CAS_CUSTOMER_UPDATE
2024-02-21T14:02:03.461Z INFO 1 --- [customer-master-service] [ main] [ ] tomerMasterServiceApplicationApplication : Started CustomerMasterServiceApplicationApplication in 22.136 seconds (process running for 23.454)
2024-02-21T14:02:04.282Z ERROR 1 --- [customer-master-service] [ntainer#0-0-C-1] [ ] o.s.k.l.KafkaMessageListenerContainer : Stopping container due to an Error
2024-02-21T14:02:04.285170248Z java.lang.NoSuchFieldError: CLIENT_ENDPOINT
at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.executeAssumeRoleWithWebIdentity(AWSSecurityTokenServiceClient.java:994) ~[aws-java-sdk-sts-1.11.986.jar!/:na] 2024-02-21T14:02:04.285184208Z at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.assumeRoleWithWebIdentity(AWSSecurityTokenServiceClient.java:976) ~[aws-java-sdk-sts-1.11.986.jar!/:na]
at com.amazonaws.auth.STSAssumeRoleWithWebIdentitySessionCredentialsProvider.newSession(STSAssumeRoleWithWebIdentitySessionCredentialsProvider.java:149) ~[aws-java-sdk-sts-1.11.986.jar!/:na]
at com.amazonaws.auth.STSAssumeRoleWithWebIdentitySessionCredentialsProvider.access$000(STSAssumeRoleWithWebIdentitySessionCredentialsProvider.java:40) ~[aws-java-sdk-sts-1.11.986.jar!/:na]
at com.amazonaws.auth.STSAssumeRoleWithWebIdentitySessionCredentialsProvider$1.call(STSAssumeRoleWithWebIdentitySessionCredentialsProvider.java:65) ~[aws-java-sdk-sts-1.11.986.jar!/:na]```
2
Answers
Solved by adding dependency, sts dependency was missing
Its old and known issue mismatching versions of sdk core and sqs modules, you might want to match those versions manually by editing the pom.xml file dependency trees, SDK modules should be all in the same version ideally. You need to match both versions to work properly
as per Maven this works, updating pom.xml with this, update maven project with latest dependencies should work and resolve dependencies, having different version will have issues so CDK coming in wrapping over all dependencies as a result snapshot file size will be bigger in that case