Skip to content

Instantly share code, notes, and snippets.

@sterlp
Created May 29, 2021 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sterlp/3a2c04dcfac7bf99cf79e79e3bbc818c to your computer and use it in GitHub Desktop.
Save sterlp/3a2c04dcfac7bf99cf79e79e3bbc818c to your computer and use it in GitHub Desktop.
Add Netflix Hystrix and hystrix.stream endpoint to Spring Boot 2.4.x
@Configuration
public class HystrixConfig {
@Bean
public ServletRegistrationBean<HystrixMetricsStreamServlet> hystrixStreamServlet(){
return new ServletRegistrationBean<>(new HystrixMetricsStreamServlet(), "/hystrix.stream");
}
}
<properties>
<hystrix.version>1.5.18</hystrix.version>
</properties>
<dependencies>
<dependency>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-request-servlet</artifactId>
<version>${hystrix.version}</version>
</dependency>
<dependency>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-metrics-event-stream</artifactId>
<version>${hystrix.version}</version>
</dependency>
<!-- support for rx result types in spring boot -->
<dependency>
<groupId>io.reactivex</groupId>
<artifactId>rxjava-reactive-streams</artifactId>
</dependency>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment