Assuming that I like 100000 events on my rabbitmq queue, what is the best way to limit a system to handle them in series vs trying to consume all at once?
I'm trying several options, however, the machine freezes trying to handle them all at once.
Assuming that I like 100000 events on my rabbitmq queue, what is the best way to limit a system to handle them in series vs trying to consume all at once?
I'm trying several options, however, the machine freezes trying to handle them all at once.
You can do ( assuming you're using amqplib)
channel.get('queueName', (err, msgOrFalse) => {
if (err) {
// Handle err
} else if (msgOrFalse) {
// Handle message
}
};
This gets messages one by one, so it's not all at once. You need to call repeatedly of course.
I've found my answer, I just need to use prefetch
to ensure that I can handle n number of values at once.