【问题标题】:How to use zuul in spring cloud without spring boot actuator?如何在没有spring boot actuator的情况下在spring cloud中使用zuul?
【发布时间】:2016-10-26 01:53:38
【问题描述】:

我想在我的应用程序中使用zuul作为代理服务器,但我不想使用spring boot actuator,我尝试将其从依赖项中删除,如下所示:

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-zuul</artifactId>
        <version>${spring-cloud-netflix.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-actuator</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

但是,它会导致一些 ClassNotFoundException。 我的应用程序中不需要 spring boot 执行器,但它在 spring boot 中有很多自动配置,会产生许多我不想要的端点。 有什么好办法解决吗?

【问题讨论】:

  • 您能否更具体地了解错误发生的时间以及您的 pom.xml 的更多内容,以便我查看您使用的版本?我用下面的 pom.xml 试过了,它开始得很好。 gist.github.com/spencergibb/2904bbb06d1b7240223e6313d9b9c451
  • 我用的是1.1.2.RELEASE的版本。我认为问题出在 org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper,它使用来自执行器的 TraceRepository。好像我从 ZuulProxyConfiguration 中删除了这个 bean,我的应用程序工作正常。
  • 感谢您的信息。
  • FWIW,您可以通过在 application.properties 中设置 management.port= 将这些端点分隔到非公共端口

标签: spring-boot spring-cloud netflix-zuul spring-boot-actuator spring-cloud-netflix


【解决方案1】:

spring cloud netflix 1135 已解决该问题。它很快就会在 Brixton.SR2 中提供。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-12-23
    • 1970-01-01
    • 2016-06-01
    • 2020-04-24
    • 2015-02-21
    • 2021-04-25
    • 1970-01-01
    • 2016-09-20
    相关资源
    最近更新 更多