'Vert.x worker instances non Round-Robin message processing

Based on the documentation and some testing, I am seeing that Vert.x queues messages in round-robin manner for instances of a Vertical e.g. if I have 2 instances of "notification" worker vertical and 10 messages are incoming,

Instance #1 processes - message # 1,3,5,7,9

Instance #2 processes - message # 2,4,6,8,10

Even if Instance #1 completes processing of all it's messages faster (due to some decision flow), still it does not receive messages pending for Instance #2. It seems like the default queueing behavior.

Is there a way to change this to dynamic queuing instead of simple round-robin at message arrival?



Solution 1:[1]

What you are looking for is a work-stealing pool, and I don't think Vert.x supports it for the moment.

From the top of my head, it may be because of the thread-safety guarantees Vert.x has, as in that all the handlers of a request should run on the same event loop.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alexey Soshin