java不使用SpringBoot就可以使用SpringCloudZuul吗?
我想使用Spring Cloud Zuul
而不使用SpringBoot
。我们有一个使用Spring的现有项目,但是我在配置Zuul
而不配置SpringBootApplication
时遇到了麻烦
使用@EnableZuulProxy注释时,出现以下错误:
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.cloud.netflix.zuul.ZuulProxyConfiguration': Unsatisfied dependency expressed through field 'discovery'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.cloud.client.discovery.DiscoveryClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
No qualifying bean of type 'org.springframework.cloud.client.discovery.DiscoveryClient' available
为什么它需要discovery客户端
我可以在没有spring boot的情况下使用spring cloud starter zuul依赖项吗
# 1 楼答案
没有,但是你可以通过Netflix OSS bits直接使用zuul https://github.com/Netflix/zuul/wiki/Getting-Started