我有一个Spring Boot应用程序,其中包含使用Jersey / JAX-RS注释实现的公共 endpoints . Hystrix仪表板使用@EnableHystrixDashboard启用,HystrixMetricsStreamServlet在“/hystrix.stream”下注册(如示例中所示) .

访问... / hystrix.stream时,度量数据可用于HystrixCommands,但 the starter dashboard page "/hystrix" is empty 可用 HTTP 404 status code .

知道为什么 Jersey 无法进入吗?

如果使用Spring WebMVC(而不是Jersey)实现相同的功能,则可以使用仪表板页面 .

我的 pom.xml

  • 不包括spring-webmvc并且取决于球衣

  • 取决于hystrix,事件流,仪表板, Actuator

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    <exclusions>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jersey</artifactId>
</dependency>
<dependency>
    <groupId>com.netflix.hystrix</groupId>
    <artifactId>hystrix-core</artifactId>
    <version>${hystrix.version}</version>
</dependency>
<dependency>
    <groupId>com.netflix.hystrix</groupId>
    <artifactId>hystrix-metrics-event-stream</artifactId>
    <version>${hystrix.version}</version>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
    <version>1.0.2.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-hystrix</artifactId>
    <version>1.0.2.RELEASE</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>com.netflix.archaius</groupId>
    <artifactId>archaius-core</artifactId>
    <version>0.6.6</version>
</dependency>