mercredi 10 janvier 2024

Retry Mechanism

I am seeking guidance for an issue related to an image downloading system. Our system interacts with various external suppliers via Kafka messages, and each message contains a list of image URLs from different domains to be downloaded. The challenge is that we have to respect the rate limits of these domains. If we make too many requests, we receive a 429 "Too Many Requests" response. We tried to mitigate this by implementing an exponential backoff strategy, but some domains still rate-limit us even after a minute of downtime. Additionally, we must maintain sequential processing for each supplier's messages to avoid database conflicts, meaning that the messages from a supplier must be processed in their original order of arrival. We're left wondering how to navigate these rate limits effectively, while ensuring sequential request handling. Any insights would be greatly appreciated!

I am thinking of solutions like Circuit Breaker pattern. Kindly suggest some ideas.

Aucun commentaire:

Enregistrer un commentaire