Reputation: 11
i've been building sqs consumer using spring aws cloud and encountering contextLoad() test case failure during gradle build. i'm using the following dependency version as recommended here.
build.gradle:
dependencies {
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
implementation 'software.amazon.awssdk:aws-sdk-java:2.21.0'
implementation 'software.amazon.kinesis:amazon-kinesis-client:2.5.1'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.13.4.2'
annotationProcessor 'org.projectlombok:lombok'
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
//spring listener
implementation platform("io.awspring.cloud:spring-cloud-aws-dependencies:${springCloudAwsVersion}")
implementation 'io.awspring.cloud:spring-cloud-aws-starter-sqs'
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
Exception:
Caused by: software.amazon.awssdk.core.exception.SdkClientException: Multiple HTTP implementations were found on the classpath. To avoid non-deterministic loading implementations, please explicitly provide an HTTP client via the client builders, set the software.amazon.awssdk.http.service.impl system property with the FQCN of the HTTP service to use as the default, or remove all but one HTTP implementation from the classpath. The multiple implementations found were: [software.amazon.awssdk.http.apache.ApacheSdkHttpService,software.amazon.awssdk.http.urlconnection.UrlConnectionSdkHttpService]
i've followed as recommended in the official spring aws cloud doc, link is attached above.However, the issue disappears when the implementation 'io.awspring.cloud:spring-cloud-aws-starter-sqs'
is removed from the dependency. which is weird , because it doesn't contain any http client impl in it.
Upvotes: 1
Views: 622