[rabbitmq-discuss] No IOException from basicPublish when connection is lost

mikael.beauvois at non.schneider-electric.com mikael.beauvois at non.schneider-electric.com
Wed Sep 28 14:59:46 BST 2011



Hi,

I have a problem when I call the basicPublish method defined in the Channel
interface.

In my client, I create a Connection using the ConnectionFactory (
com.rabbitmq.client.ConnectionFactory) to the broker running on a remote
host (connected in the local network). Then I create a Channel from this
Connection.
I call the basicPublish method in a loop (waiting 10s between each
publish). During the test, I unplug the network cable from the client
running on the local host.
The basicPublish method doesn't throw any exception (I expected at least
IOException because the network connection is lost). All calls to
basicPublish method in the loop never raise the IOException exception (or
any other exception). Obviously, the broker never received the messages
sent after loosing the network connection.

A ShutdownListener has been implemented but the shutdownCompleted method
is called by the RabbitMQ java client stack around 15 minutes after
unplugging the network cable.

I also tested the disconnection using the command line in a terminal. The
results are the same.

I am running RabbitMQ broker 2.6.1 with the RabbitMQ java client , Linux
Ubuntu 11.04 with kernel 2.6.38-11 (x86) and I tested my code with 2 JVM
(OpenJDK and Java HotSpot 1.6.0 (build 1.6.0_27-b07)).

Please, could you help me?

Best regards

Mikael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110928/77a365e6/attachment.htm>


More information about the rabbitmq-discuss mailing list