I was referring below tutorial https://www.linkedin.com/pulse/spring-boot-microservices-circuit-breaker-mohamed-firnas I have added required dependencies but my follwoing import is not working import io.github.resilience4j.circuitbreaker.annotation.CircuitBreaker and then in Error Logs we checked this error was coming Unresolved dependency: io.github.resilience4j:resilience4j-spring-boot2:1.17.1 . I am not sure why it is not working?
build.gradle
plugins {
id 'org.springframework.boot' version '2.5.0'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id 'eclipse'
}
group = 'com.demo'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
ext {
set('springCloudDependencyVersion', "2022.0.4") // 2022.0.4 is the latest one.
set('springCloudAwsVersion',"3.0.4")
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud- dependencies:$springCloudDependencyVersion"
mavenBom "io.awspring.cloud:spring-cloud-aws-dependencies:$springCloudAwsVersion"
}
}
repositories {
mavenCentral()
maven {
url "https://packages.confluent.io/maven"
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.kafka:spring-kafka'
implementation group: 'javax.validation', name: 'validation-api', version: '2.0.0.Final'
implementation "org.springframework.cloud:spring-cloud-dependencies:$springCloudDependencyVersion"
implementation 'io.awspring.cloud:spring-cloud-aws-starter-dynamodb'
//resilience4j
implementation 'io.github.resilience4j:resilience4j-spring-boot2:1.17.1'
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
// annotation processors
compileOnly 'org.projectlombok:lombok:1.18.26'
annotationProcessor 'org.projectlombok:lombok:1.18.26'
}
test {
useJUnitPlatform()
}