spring cloud zuul 설정 상세 설명

8799 단어 springcloud
spring cloud zuul 설정 상세 설명
zuul 은 spring cloud 에 게 게 이 트 웨 이 로 존재 합 니 다.주로 요청 한 배 포 를 책임 집 니 다.다음은 zuul 의 모든 핵심 설정 에 대해 자세히 설명 하 겠 습 니 다.
zuul:
  #       ,   false
  #              ,          ribbon      
  #        
  #          org.springframework.retry
  #         spring-retry
  #    
  retryable: false
  #          ,              /api
  prefix: /api
  #          header          ,   "Cookie", "Set-Cookie", "Authorization"
  #     PreDecorationFilter.run()   ,               ignored-headers  
  sensitive-headers:
    - Cookie
    - Set-Cookie
    - Authorization
    - token
  #            ,       ProxyRequestHelper.buildZuulRequestHeaders(HttpServletRequest request)    ,
  #       ignored-headers      header        header ribbon  
  ignored-headers:
    - token
  #       SimpleHostRoutingFilter  ,RibbonRoutingFilter    ribbon   
  host:
    #      ,   200
    max-total-connections: 200
    #               ,   20
    max-per-route-connections: 20
    # http client  connection pool     connection     ,   -1,   
    connection-request-timeout-millis: -1
    #          ;,   2000ms
    connect-timeout-millis: 2000
    #       ,   10000ms
    socket-timeout-millis: 10000
  #     
  routes:
    #          ,     Map
    user-server:
      #             ,       ,      /user-server/**
      path: /user-server/**
      # spring cloud  id,             
      serverId: user-server
      #        prefix,   true,  false          /api
      stripPrefix: true
      #             ,   ribbon、hystrix,      RibbonRoutingFilter,     SimpleHostRoutingFilter
      url: http://localhost:9000
      #          ,         
      sensitive-headers:
        - Cookie
        - Set-Cookie
        - Authorization
      #          ,   false,       sensitive-headers      ,    0  true
      custom-sensitive-headers: false
  #    THREAD(     ), SEMAPHORE(     ),   SEMAPHORE
  #       hystrix  ,        HystrixCommond,hystrix         、     
  ribbonIsolationStrategy: SEMAPHORE
  #                   ,   100,           100          100
  semaphore:
    maxSemaphores: 100
  #             ,      100
  eureka:
    #          
    user-server:
      #      
      semaphore:
        #      ,            100,              
        #        AbstractRibbonCommand.getSetter(final String commandKey,ZuulProperties zuulProperties, IClientConfig config)    
        maxSemaphores: 100
        
# ribbon  ,ribbon       RibbonClientConfiguration.ribbonClientConfig()
#      config.loadProperties(this.name);       ribbon   
#       eureka                    http       ,                     
ribbon:
  #          DefaultLoadBalancerRetryHandler         
  #     :public DefaultLoadBalancerRetryHandler(IClientConfig clientConfig)
  #              ,   false,               GET  ,     true      
  #   :return HttpMethod.GET == method || lbContext.isOkToRetryOnAllOperations();
  #         RetryTemplate.doExecute(RetryCallback retryCallback,RecoveryCallback recoveryCallback, RetryState state)
  #           ,N       ,R    
  #      MaxAutoRetries=1,MaxAutoRetriesNextServer=1,      4 
  # NR NR
  #      MaxAutoRetries=2,MaxAutoRetriesNextServer=1,      6 
  # NRR NRR
  #      MaxAutoRetries=1,MaxAutoRetriesNextServer=2,      6 
  # NR NR NR
  #      MaxAutoRetries=2,MaxAutoRetriesNextServer=2,      9 
  # NRR NRR NRR
  OkToRetryOnAllOperations: true
  #         ,   0
  MaxAutoRetries: 1
  #         ,   1
  MaxAutoRetriesNextServer: 2        

좋은 웹페이지 즐겨찾기