<div dir="ltr"><div><div><div><div><br></div>Hi MK,<br><br></div>I am aware of the heartbeat setting. However, my application is running on mobile phone I afraid that if I set the value to lower value like 10s it will consume more battery power and also cause higher data usage.<br>

<br></div>Yes, I can receive all messages ultimately. However, I hope that I can get those messages in real-time and in the order those messages were published.<br><br>&quot;Your problem is likely that the unacknowledged messages on the old 
connection are not being re-queued until RabbitMQ detects connection 
closure.&quot;<br></div>Is there any way to ensure that the unacknowledged messages on the old 
connection are being re-queued immediately and being delivered to other consumer?<br><div><br><div><div>Regards,<br></div><div>Nick<br></div><div>� <br></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Sat, Nov 2, 2013 at 4:17 PM, Michael Klishin <span dir="ltr">&lt;<a href="mailto:mklishin@gopivotal.com" target="_blank">mklishin@gopivotal.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 2 Nov 2013, at 09:31, Liong Hung Wong &lt;<a href="mailto:lhwong@gmail.com">lhwong@gmail.com</a>&gt; wrote:<br>
<br>
&gt; I am jusing rabbitmq-java client. is this a bug?<br>
&gt;<br>
&gt; What can I do to ensure that I can receive all of the messages immediately even in the scenario in which IP is different?<br>
<br>
This is how TCP works: it retries retransmission and waits for a certain period of time<br>
before completely closing the connection.<br>
<br>
Heartbeat timeout is the feature that undoes this. Set it to a lower value (say, 10 seconds)<br>
in the client:<br>
<br>
<a href="http://hg.rabbitmq.com/rabbitmq-java-client/file/718eae51bf20/src/com/rabbitmq/client/ConnectionFactory.java#l325" target="_blank">http://hg.rabbitmq.com/rabbitmq-java-client/file/718eae51bf20/src/com/rabbitmq/client/ConnectionFactory.java#l325</a><br>

<br>
You *can* receive all the messages from a different connection. Whether the client IP is the same does not matter.<br>
Your problem is likely that the unacknowledged messages on the old connection are not being re-queued until RabbitMQ detects connection closure.<br>
<br>
Again, see above about heartbeat setting in the client.<br>
<br>
MK<br>
<br>
Software Engineer, Pivotal/RabbitMQ<br>
<br>
<br>
</blockquote></div><br></div>