<div dir="ltr">We are testing unfinished messages scenario in RabbiMQ, where am running two consumers in separate command prompts, here Producer sends messages from &quot;Message1 to Message10&quot; and two consumers will consume messages in round-robin passion like &quot;Message1&quot; goes to &quot;Consumer1&quot; and &quot;Message2&quot; will go to &quot;Consumer2&quot;, etc.  To test unfinished messages what I have done is when one of the consumer [ex.Consumer2] received &quot;Message2&quot; then am not sending acknowledgement back to the server.  In this case as per the documentation other consumer[Consumer1] has to consume message[Message2] from the server right? But, Its not happening, Consumer1 consuming remaining messages but not &quot;Message2&quot;, why?<div>
<br></div><div><br></div><div>Please find the sample code at consumer end below- </div><div><br></div><div>while (true) {<br></div><div><div><span class="" style="white-space:pre">                </span>QueueingConsumer.Delivery delivery = consumer.nextDelivery();</div>
<div><span class="" style="white-space:pre">                </span>String message = new String(delivery.getBody());</div><div><span class="" style="white-space:pre">                                </span></div><div><span class="" style="white-space:pre">        </span><span class="" style="white-space:pre">        </span>System.out.println(&quot; [x] Received &#39;&quot; + message + &quot;&#39;&quot;);</div>
<div><span class="" style="white-space:pre">                </span>doWork(message);</div><div><span class="" style="white-space:pre">                </span>System.out.println(&quot; [x] Done&quot;);</div><div><br></div><div><span class="" style="white-space:pre">        </span><span class="" style="white-space:pre">        </span>if(!message.equals(&quot;Message2&quot;)){</div>
<div><span class="" style="white-space:pre">                        </span>channel.basicAck(delivery.getEnvelope().getDeliveryTag(), false);</div><div><span class="" style="white-space:pre">                </span>}</div></div><div>}</div><div><br></div><div>
Thanks in advance!</div></div>