微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Hystrix断路器自动打开并且应用程序给出网关超时错误为什么?我使用上下文类实现代码

如何解决Hystrix断路器自动打开并且应用程序给出网关超时错误为什么?我使用上下文类实现代码

  hytrix impl which i used into a application its a common class which all request use and enable hytrix by adding filters.Basically problem is when we put load on site the threads becomes high and on 100 users site will goes gatewaytimeout. Plz Help. I Shared the Impl of hystrix and Properties which I Used for Hystrix.

------这些是我用于hystrix的属性------ execution.isolation.thread.timeoutInMilliseconds = 60000 execution.timeout.enabled = false execution.isolation.strategy =线程 hystrix.command.default.execution.timeout.enabled = false execution.isolation.thread.timeoutInMilliseconds = 400 hystrix.command.default.fallback.enabled = true hystrix.command.default.circuitBreaker.enabled = false hystrix.command.default.circuitBreaker.forceClosed = false hystrix.command.default.circuitBreaker.sleepWindowInMilliseconds = 5000 hystrix.command.default.circuitBreaker.requestVolumeThreshold = 20 hystrix.command.default.metrics.rollingStats.timeInMilliseconds = 80000 hystrix.threadpool.default.coreSize = 150 #hystrix.threadpool.default.keepAliveTimeMinutes = 1 hystrix.threadpool.default.allowMaximumSizetodivergeFromCoreSize = true hystrix.threadpool.default.maxQueueSize = 100000 hystrix.threadpool.default.queueSizeRejectionThreshold = 100000

Hystrix的偶像

 @Override
public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain) throws IOException,servletexception {
    HystrixRequestContext context = HystrixRequestContext.initializeContext();
    SecurityContextHystrixRequestvariable.getInstance().set(SecurityContextHolder.getContext());
    
    try {
        chain.doFilter(request,response);
    } catch(Throwable bce){
        LOGGER.error("Some exception",bce);
    }
}
 




   

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。