[rabbitmq-discuss] previous connection is NOT automatically closed if IP different

Michael Klishin mklishin at gopivotal.com
Sat Nov 2 08:17:24 GMT 2013


On 2 Nov 2013, at 09:31, Liong Hung Wong <lhwong at gmail.com> wrote:

> I am jusing rabbitmq-java client. is this a bug? 
> 
> What can I do to ensure that I can receive all of the messages immediately even in the scenario in which IP is different? 

This is how TCP works: it retries retransmission and waits for a certain period of time
before completely closing the connection.

Heartbeat timeout is the feature that undoes this. Set it to a lower value (say, 10 seconds)
in the client:

http://hg.rabbitmq.com/rabbitmq-java-client/file/718eae51bf20/src/com/rabbitmq/client/ConnectionFactory.java#l325

You *can* receive all the messages from a different connection. Whether the client IP is the same does not matter.
Your problem is likely that the unacknowledged messages on the old connection are not being re-queued until RabbitMQ detects connection closure.

Again, see above about heartbeat setting in the client.

MK

Software Engineer, Pivotal/RabbitMQ




More information about the rabbitmq-discuss mailing list