简体   繁体   中英

Feign client with Hystrix throwing exception

I have requirement to call a service multiple times (>50 times) and aggregate the responses. So I have decided to go for CompletableFuture with Async and CustomExecuter (its own threadpool) to make it faster instead of waiting for the service to respond.

I am using feign client with ApacheHTTP and Hystrix on the classpath. I can see it is working sometimes and sometimes I am getting exceptions as the circuit is open.

Can somebody tell me if it is a correct approach to make parallel calls to service or shall I go with sequential like calling the service in loop? Keeping in mind that thread pool should not be exhausted. I have kept below configuration.

apacheHttpClient:
  maxConnections: 10

hystrix:
  threadpool:
    default:
      coreSize: 100

executorService:
  threadPool: 50

Have you considered feign w/Vertex? "Brings you the best of two worlds together : concise syntax of Feign to write client side API on fast, asynchronous and non-blocking HTTP client of Vertx." https://github.com/OpenFeign/feign-vertx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM