Maybe you are looking for Fair dispatch (https://www.rabbitmq.com/tutorials/tutorial-two-java.html) based on QoS.
channel.basicQos(1);
Using a QoS(1) one consumer is busy until doesn’t send the ACK
,in this case another message is send to the next free consumer.
So if a consumer has a long process to do, it doesn’t receive messages.
If there are not a free consumers the messages remain to the queue.