J.Chan
J.Chan

Reputation: 1

Edgware.Release CANNOT configure the zuul time out by hystrix.command.default but [serviceId]

hystrix:
  command:
    default:
      execution:
        timeout:
          enabled: true
        isolation:
          thread:
            timeoutInMilliseconds: 30000

This property does not work until I replace 'default' with my serviceId. I just saw the doc of Edgware.Release configure the zuul timeout using default for the commandKey.

More Info, I find the hytrix command is RibbonCommand when I debug in my program, and The commandKey is always equal my serviceId. And I find no where to change it in the spring cloud doc.

And This is my application.yml

server:
  port: 80
spring:
  application:
    name: mofeng-pay-zuul
  ##zipkin:
  ##  base-url: http://localhost:7000
  ##sleuth:
  ##  sampler:
  ##    percentage: 1.0
eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/

logging:
  level:
    com:
      DEBUG
  file: ${JAVA_LOG_HOME}/zuul.log

zuul:
  ribbonIsolationStrategy: THREAD
  threadPool:
    useSeparateThreadPools: true
  host:
    connections: 500
    socket-timeout-millis: 30000
    connect-timeout-millis: 30000

ribbon:
  ReadTimeout: 10000
  ConnectTimeout: 10000
  MaxAutoRetries: 1
  MaxAutoRetriesNextServer: 1
  eureka:
    enabled: true
  eager-load:
    enabled: true
    clients: 
    - client-service


hystrix:
  command:
    client-service:
      execution:
        timeout:
          enabled: true
        isolation:
          thread:
            timeoutInMilliseconds: 30000

Removing the hystrix configuration and appending the config as follows:

client-service:
  ribbon:
    ConnectTimeout: 10000
    ReadTimeout: 30000
    MaxTotalHttpConnections: 500
    MaxConnectionsPerHost: 100

It still does not work.

Upvotes: 0

Views: 291

Answers (1)

yongsung.yoon
yongsung.yoon

Reputation: 5589

It is a bug (actually an improvement) that was changed in Edgware.SR1.

https://github.com/spring-cloud/spring-cloud-netflix/pull/2633

In Edgware.RELEASE, you can not use Hystrix timeout with default key because timeout is set in the code with Ribbon connection timeout plus read timeout. The only way to set timeout in Edgware.RELEASE is setting timeout with command key (service id).

But it was changed. Please try to use Edgware.SR1 or later.

Upvotes: 1

Related Questions