私は、Jersey/JAX-RS アノテーションで実装されたパブリック エンドポイントを持つ Spring Boot アプリケーションを持っています。Hystrix ダッシュボードは @EnableHystrixDashboard で有効になり、HystrixMetricsStreamServlet は「/hystrix.stream」の下に登録されます (例にあるように)。
.../hystrix.stream にアクセスすると、HystrixCommands でメトリクス データを使用できますが、スターター ダッシュボード ページ "/hystrix" は空で、HTTP 404 ステータス コードが表示されます。
Jerseyでアクセスできない理由は何ですか?
Spring WebMVC (Jersey ではない) で同じことが実装されている場合、ダッシュボード ページが利用可能です。
私のpom.xml
- spring-webmvc を除外し、ジャージーに依存します
- hystrix、イベントストリーム、ダッシュボード、アクチュエータに依存
-
<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>