-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Description
I noticed that the ConsumerFunc does not support async, so the client doesn't wait for the consumer function to finish before processing more messages. The problem is that my CPU becomes overwhelmed when receiving 1,000,000 messages in a short amount of time.
Is there a way to solve this problem ? The only temporary fix I have is to enqueue all the asynchronous calls in a queue, but that seems a bit overkill and not very efficient.
const consumer = await this.client.declareConsumer({
...
}, (message) => {
this.worker.enqueue(async () => {
...
})
})
Thank you,
Metadata
Metadata
Assignees
Labels
No labels