use @EnableDiscoveryClient and @EnableCircuitBreaker
This commit is contained in:
@@ -30,20 +30,20 @@ public class EurekaClientCompilerAutoConfiguration extends CompilerAutoConfigura
|
||||
|
||||
@Override
|
||||
public boolean matches(ClassNode classNode) {
|
||||
return AstUtils.hasAtLeastOneAnnotation(classNode, "EnableEurekaClient");
|
||||
return AstUtils.hasAtLeastOneAnnotation(classNode, "EnableDiscoveryClient");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyDependencies(DependencyCustomizer dependencies) {
|
||||
dependencies.ifAnyMissingClasses(
|
||||
"org.springframework.cloud.netflix.eureka.EnableEurekaClient").add(
|
||||
"org.springframework.cloud.netflix.eureka.EnableDiscoveryClient").add(
|
||||
"spring-cloud-starter-eureka");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyImports(ImportCustomizer imports) throws CompilationFailedException {
|
||||
imports.addImports(
|
||||
"org.springframework.cloud.netflix.eureka.EnableEurekaClient",
|
||||
"org.springframework.cloud.client.discovery.EnableDiscoveryClient",
|
||||
"org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean",
|
||||
"org.springframework.cloud.netflix.eureka.EurekaClientConfigBean",
|
||||
"com.netflix.discovery.DiscoveryClient",
|
||||
|
||||
@@ -43,7 +43,7 @@ public class EurekaServerCompilerAutoConfiguration extends CompilerAutoConfigura
|
||||
@Override
|
||||
public void applyImports(ImportCustomizer imports) throws CompilationFailedException {
|
||||
imports.addImports("org.springframework.cloud.netflix.eureka.server.EnableEurekaServer",
|
||||
"org.springframework.cloud.netflix.eureka.EnableEurekaClient",
|
||||
"org.springframework.cloud.client.discovery.EnableDiscoveryClient",
|
||||
"org.springframework.cloud.netflix.eureka.EurekaServerConfigBean",
|
||||
"org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean",
|
||||
"org.springframework.cloud.netflix.eureka.EurekaClientConfigBean",
|
||||
|
||||
@@ -30,20 +30,20 @@ public class HystrixCompilerAutoConfiguration extends CompilerAutoConfiguration
|
||||
|
||||
@Override
|
||||
public boolean matches(ClassNode classNode) {
|
||||
return AstUtils.hasAtLeastOneAnnotation(classNode, "EnableHystrix");
|
||||
return AstUtils.hasAtLeastOneAnnotation(classNode, "EnableCircuitBreaker");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyDependencies(DependencyCustomizer dependencies) {
|
||||
dependencies.ifAnyMissingClasses(
|
||||
"org.springframework.cloud.netflix.hystrix.EnableHystrix")
|
||||
"org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker")
|
||||
.add("spring-cloud-starter-hystrix");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyImports(ImportCustomizer imports) throws CompilationFailedException {
|
||||
imports.addImports(
|
||||
"org.springframework.cloud.netflix.hystrix.EnableHystrix",
|
||||
"org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker",
|
||||
"com.netflix.hystrix.contrib.javanica.annotation.HystrixCollapser",
|
||||
"com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user