[rabbitmq-discuss] previous connection is NOT automatically closed if IP different
matthias at rabbitmq.com
Sat Nov 2 15:14:43 GMT 2013
On 02/11/13 13:39, L H, Wong wrote:
> 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?
"immediately" when *what* happens?
If a client properly closes the rabbitmq connection (through the API or
even just doing a full TCP connection closure handshake) then messages
pending ack will get re-queued right at that point.
If, OTOH, there is just some network disruption then rabbit won't know
the connection is dead until various TCP-level timeouts kick in. That is
fundamental to the design of TCP.
AMQP heartbeats exist to give applications control over connection
liveness. So if you want to ensure dead connections get detected
promptly, then use a low AMQP heartbeat interval. The "any way" you are
looking for is exactly that. As Michael explained already.
> if I set the value to lower value like 10s it will consume more
> battery power and also cause higher data usage.
There is no other way to do this. Peers of a connection cannot magically
detect that the connection is dead. It requires either a positive signal
(such as controlled connection closure), or negative signal (absence of
any traffic for some duration of time).
More information about the rabbitmq-discuss