04 eureka consumer feign - RickJou/SpringCloudDemo GitHub Wiki

重要配置

application.properties

注意事项

  • 连接数配置

    客户端到所有服务端的连接总数
    eureka.client.eureka-server-total-connections=200

    客户端到每个服务端的连接总数
    eureka.client.eureka-server-total-connections-per-host=50

  • ribbon全局配置

    ribbon.ConnectTimeout=500

    ribbon.ReadTimeout=5000

  • ribbon针对单一服务做配置

    EUREKA-PRODUCER.ribbon.ConnectTimeout=500

    EUREKA-PRODUCER.ribbon.ReadTimeout=20000

    EUREKA-PRODUCER.ribbon.OkToRetryOnAllOperatines=true

    EUREKA-PRODUCER.ribbon.MaxAutoRetriesNextServer=1

    EUREKA-PRODUCER.ribbon.MaxAutoRetries=1

  • hystry全局配置

    hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=20000 hystrix.command.default.execution.timeout.enabled=true

  • 启用hystrix

    feign.hystrix.enabled=true

  • 压缩消息 feign.compression.request.enabled=true feign.compression.request.mime-types=text/xml,application/xml,application/json feign.compression.request.mim-requuest-size=2048 feign.compression.response.enabled=true