Spring Boot和Zuul代理deferringLoadBalancerexChangeFilterFilterFunction错误

发布于 2025-01-31 02:13:53 字数 596 浏览 3 评论 0原文

我有一个简单的应用程序,该应用程序使用Netflix Zuul作为API网关,

我在pom.xml文件中添加了Zuul依赖性,如下所示:

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
    <version>2.2.10.RELEASE</version>
</dependency>

@enableZuulProxy应用程序的主要类别的

问题,问题是每当我尝试运行API,它无法启动并在控制台中显示:

考虑定义一种类型的豆 'org.springframework.cloud.client.loadbalancer.reactive.deferringloadbalancerexchangefilterfilter'' 在您的配置中。

我无法解决问题,有什么问题?

I have a simple app that uses Netflix Zuul as an API gateway

I added the Zuul dependency in the pom.xml file as follows:

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
    <version>2.2.10.RELEASE</version>
</dependency>

and @EnableZuulProxy for the main class of the app

The problem is that whenever I try to run the API, It fails to start and shows in the console:

Consider defining a bean of type
'org.springframework.cloud.client.loadbalancer.reactive.DeferringLoadBalancerExchangeFilterFunction'
in your configuration.

I couldn't solve the issue, what's the problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

记忆で 2025-02-07 02:13:53

当我在pom.xml中添加以下依赖性时,解决了问题:

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-loadbalancer</artifactId>
    </dependency>

结果,Spring还要求我将其添加到我的应用程序配置中:

spring.main.web-application-type=reactive

然后,我的API成功运行而不会失败或抛出任何例外

The issue was solved when I added the following dependency in pom.xml:

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-loadbalancer</artifactId>
    </dependency>

and as a result, spring also asked me to add this to my app configuration:

spring.main.web-application-type=reactive

Then my API ran successfully without failing or throwing any exception

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文