DEV Community

Discussion on: The Circuit Breaker Pattern

Collapse
 
xowap profile image
Rémy 🤖

Interesting article, although I wonder if this is not a problem better externalized to a specialized tool like a queue system?

The queue can store all the requests, handle the retries, is easily monitored by all mainline tools and baking asynchronicity into your app mechanically handles failures.

This being said, I'm probably missing the point.

Collapse
 
frenchcooc profile image
Corentin

Hi Rémy! A queue is definitely a great way of handling external requests.

The code sample here considers that the API requests are made from the application (and not from a queue). This is a common pattern amongst many applications.

But I think that the code sample could apply to a custom-made queue on which you would add a circuit breaker.