2

I have the following call hierarchy in my architecture:

BFF → Microservice A → Microservice B → Anticorruption Layer → Legacy System

In each service above I am using the retry pattern to deal with HTTP resiliency while one service request a resource in another service.

The problem becomes when, if I have a default policy of 3 retries for each request, this becomes exponential. For example, if my AntiCorruptionLayer is down and returning a 504 (Gateway timeout) and my BFF receives one request, it will retry for 3 times, while service A will retry for 9 times and B for 27 times for just one request!

How to deal with this problem? Any tips?

GuFigueiredo
  • 635
  • 1
  • 9
  • 18
  • I don't understand. Retires only happen when the request fails. That means services down the chain do not make any requests at all. – yuri kilochek Feb 04 '20 at 22:36
  • @yurikilochek No. Given the scenario above, if my AnticorriptionLayer is down and returning, for example, a 504 Gateway Timeout, the call hierarchy will occur in a exponential way. All services have a retry policy of 3 times for failed requests, so if my BFF receives one request, it will retry 3 times, but A will retry 9 and B will retry 27 times. Maybe should I use a circuit breaker too? – GuFigueiredo Feb 05 '20 at 14:09
  • 1
    There is only one active chain in this tree of requests at any time, so I fail to see the problem. For BFF to report that a downstream service is down? You can just put a timeout on each request. – yuri kilochek Feb 05 '20 at 17:28

0 Answers0