首页 > 解决方案 > FeignClient 在 SpringBoot 应用程序中出现“503 Service Unavailable”错误

问题描述

我有两个简单的服务,服务 A 使用 feignclient 调用服务 B。这两个服务真的很简单,但是我在调​​用服务 B 时经常遇到 503 Service Unavailable 错误。第一次调用总是有效,但是这个错误发生在第二次调用。没有特殊配置,使用默认配置。有谁知道如何解决这个问题?

feign:
  httpclient:
    connection-timeout: 10000
    read-timeout: 60000
    max-connections: 100
    max-connections-per-route: 100
    enabled: true
  client:
    config:
      default:
        connect-timeout: 60000
        read-timeout: 60000
        logger-level: full
  hystrix:
    enabled: true
hystrix:
  command:
    default:
      execution:
        timeout:
          enabled: false
        isolation:
          thread:
            timeoutInMilliseconds: 10000
    others:
      execution:
        timeout:
          enabled: true
        isolation:
          thread:
            timeoutInMilliseconds: 3000

标签: spring-cloud-feignopenfeign

解决方案


推荐阅读