I'm facing this issues in spring-cloud-netflix and trying to address the same. Since I cannot disable stuck-thread max-time for my managed-servers, I'm trying to assign a work-manager with stuck-thread max-time disabled to HystrixMetricsStreamServlet. This is the approach I though of.
ServletWrappingEndpoint bean wrapping the HystrixMetricsStreamServlet. ServletWrappingEndpoint class to accept ServletWrappingController in it's constructor since ServletWrappingEndpoint does not allow setting init params. (Calling the getController() getter would cause _invoking overridable methods from constructors_).That class is going to go away in 2.0.0. I'd suggest you just copy it and make whatever changes you need. I doesn't do much.
Thanks @spencergibb. I found the same issue with ProxyStreamServlet as well and the workaround is not straight-forward since ProxyStreamServlet bean construction is not conditional on any property. The workaround is to sub-class HystrixDashboardConfiguration and introduce a new _Enable_ annotation. i.e.
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Import(HystrixWebLogicDashboardConfiguration.class)
public @interface EnableWebLogicHystrixDashboard {
}
@Configuration
public class HystrixWebLogicDashboardConfiguration extends HystrixDashboardConfiguration {
@Autowired
private HystrixDashboardProperties dashboardProperties;
@Bean
public ServletRegistrationBean proxyStreamServlet() {
ProxyStreamServlet proxyStreamServlet = new ProxyStreamServlet();
proxyStreamServlet.setEnableIgnoreConnectionCloseHeader(dashboardProperties.isEnableIgnoreConnectionCloseHeader());
ServletRegistrationBean bean = new ServletRegistrationBean(proxyStreamServlet, "/proxy.stream");
bean.addInitParameter("wl-dispatch-policy", "WorkManager-Hystrix");
return bean;
}
}
However, in order to avoid such workarounds for WebLogic users, it would be nicer to have the following configurations
ProxyStreamServlet to accept some init parameters from properties.hystrix.proxy-servlet.init.parameter.name=
hystrix.proxy-servlet.init.parameter.value=
May be an array of such params...
HystrixMetricsStreamServlet through ServletRegistrationBean, rather than exposing it as an Endpoint. Also to accept some init parameters from properties - - same as above.HystrixDashboardProperties could be enhanced to have a map of init parameters. Hystrix has already been changed to accept init params in 2.0.x see 61513287ce078f7ef57ca480b8a75ae0ce27b2bb
That's great! Would like to file a pull request for HystrixDashboardProperties .
@fahimfarookme absolutely!
@spencergibb Hope the target branch should be 2.0.x?
Can be master if done promptly.
For WebLogic users, until spring-cloud-netflix 2.0.x is released - here's the workaround as a library which was discussed above.