zoukankan      html  css  js  c++  java
  • spring cloud zuul 配置(Robbin 和 熔断)

    #启动负载均衡的重试机制,默认false
    spring.cloud.loadbalancer.retry.enabled=true
    #Hystrix是否启用超时时间
    hystrix.command.default.execution.timeout.enabled=true
    #Hystrix断路器的超时时间,默认是1s,断路器的超时时间需要大于ribbon的超时时间,不然不会触发重试。
    hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=2000

    #ribbon请求连接的超时时间
    ribbon.ConnectTimeout=250
    #请求处理的超时时间
    ribbon.ReadTimeout=1000
    #对所有请求操作都进行重试
    ribbon.OkToRetryOnAllOperations=true
    #对当前服务的重试次数(第一次分配给实例1的时候,如果404,则再重试MaxAutoRetries次,如果还是404,
    #则切换到其他服务MaxAutoRetriesNextServer决定)
    ribbon.MaxAutoRetries=0
    #切换服务的次数(比如本次请求分配给实例1处理,发现404,则切换分配给实例2处理,如果还是404,则返回404给客户端)
    ribbon.MaxAutoRetriesNextServer=1
  • 相关阅读:
    iframe
    # ? & 号在url中的的作用
    面向对象和面向过程
    dom
    DOM对象与jquery对象有什么不同
    绑定js
    leetcode — search-for-a-range
    leetcode — search-for-a-range
    leetcode — search-in-rotated-sorted-array
    leetcode — longest-valid-parentheses
  • 原文地址:https://www.cnblogs.com/HanShisi/p/9178862.html
Copyright © 2011-2022 走看看