You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I apologize for creating this ticket. It is not a bug but a question about using the tool.
I'm reading the doc, I even read the code a lot. However, I have doubts about the example in the documentation. After all, where is this "TooManyRequestsError" class? Was this just an example of how we should work around when a timeout occurs on the consumer?
If yes, then should I consider doing something like
consumer.run({partitionsConsumedConcurrently: 3,// Default: 1eachMessage: async({ topic, partition, message })=>{// This will be called up to 3 times concurrentlytry{awaitsendToDependency(message)}catch(e){if(einstanceofTooManyRequestsError){consumer.pause([{ topic,partitions: [partition]}])// Other partitions will keep fetching and processing, until if / when// they also get throttledsetTimeout(()=>{consumer.resume([{ topic,partitions: [partition]}])// Other partitions that are paused will continue to be paused},e.retryAfter*1000)}throwe}},})
Thanks
The text was updated successfully, but these errors were encountered:
Thanks for posting the question @guilherme90 , I also have the same question going by the docs.
My work has this use-case and hoping someone could provide the right direction here.
I believe the TooManyRequestsError is st that your service/consumer should raise when it can't keep up with the workload. Name is just an example. Also, I'd be careful with re-throwing the error, as it counts towards the max retries, eventually causing the consumer to crash.
Hello. I apologize for creating this ticket. It is not a bug but a question about using the tool.
I'm reading the doc, I even read the code a lot. However, I have doubts about the example in the documentation. After all, where is this "TooManyRequestsError" class? Was this just an example of how we should work around when a timeout occurs on the consumer?
If yes, then should I consider doing something like
Doc example
Thanks
The text was updated successfully, but these errors were encountered: