gpt4 book ai didi

java - 没有 Spring Boot 可以使用 Spring Cloud Zuul 吗?

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:49:49 32 4
gpt4 key购买 nike

我想在没有 SpringBoot 的情况下使用 Spring Cloud Zuul。我们有一个现有的 Spring 项目,但我无法在没有 SpringBootApplication 的情况下配置 Zuul

当我使用@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

为什么它需要一个发现客户端?

我可以在没有 spring-boot 的情况下使用 spring-cloud-starter-zuul 依赖吗?

最佳答案

不,但您可以通过 Netflix OSS 位直接使用 zuul https://github.com/Netflix/zuul/wiki/Getting-Started

关于java - 没有 Spring Boot 可以使用 Spring Cloud Zuul 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45512599/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com