<div dir="ltr"><div class="gmail_quote">
<blockquote style="border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote">
<div>
<div>Hi,</div></div></blockquote>
<div> </div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px"><b><font color="#674ea7">>> when I disconnect the network cable, say it gets disconnected when both receiving and publishing takes place.. (Message published and received are different messages(same exchange))</font>  ----> say the name is exchange1 published from server side</b></span><br>
</div><div><br></div>
<div>Connections, channels, exchange, queue, binding all can be viewed  in Management plugin after reconnecting the network cable. From this can i assume that reconnection is successful?</div>
<div>But if from server side there is a publish to same exchange (exchange1)  after reconnecting (say the server publish some message after 5mins of reconnection) , then i still get this error.</div>
<div> </div>
<div><div>DefaultExceptionHandler: Consumer com.rabbitmq.client.QueueingConsumer@5edcf5 (amq.ctag-AcMX2m0FBSPePzrjNqDi7Z) method handleDelivery for channel AMQChannel(amqp://guest@localhost:5672/,1) threw an exception for channel AMQChannel(amqp://guest@localhost:5672/,1):</div>
<div>com.rabbitmq.client.ShutdownSignalException: connection error</div><div><span class="" style="white-space:pre">        </span>at com.rabbitmq.client.QueueingConsumer.checkShutdown(QueueingConsumer.java:172)</div><div><span class="" style="white-space:pre">   </span>at com.rabbitmq.client.QueueingConsumer.handleDelivery(QueueingConsumer.java:124)</div>
<div><span class="" style="white-space:pre">    </span>at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:140)</div><div><span class="" style="white-space:pre">  </span>at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:85)</div>
<div><span class="" style="white-space:pre">    </span>at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)</div><div><span class="" style="white-space:pre">     </span>at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)</div>
<div><span class="" style="white-space:pre">    </span>at java.lang.Thread.run(Thread.java:619)</div><div>Caused by: java.net.SocketException: Software caused connection abort: recv failed</div><div><span class="" style="white-space:pre">  </span>at java.net.SocketInputStream.socketRead0(Native Method)</div>
<div><span class="" style="white-space:pre">    </span>at java.net.SocketInputStream.read(SocketInputStream.java:129)</div><div><span class="" style="white-space:pre">     </span>at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)</div>
<div><span class="" style="white-space:pre">    </span>at java.io.BufferedInputStream.read(BufferedInputStream.java:237)</div><div><span class="" style="white-space:pre">  </span>at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:271)</div>
<div><span class="" style="white-space:pre">    </span>at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95)</div><div><span class="" style="white-space:pre">  </span>at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:139)</div>
<div><span class="" style="white-space:pre">    </span>at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:532)</div><div><span class="" style="white-space:pre">     </span>... 1 more</div></div><div><br></div>
<div><br></div>
<div>I am not getting how to solve this..</div><div>When checked in Management plugin, after getting this exception, Channel and Queue is no more available.</div><div><br></div><div><div style="font-family:arial,sans-serif;font-size:13px">
to receive message what I do is --> </div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">while(true){</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">try{</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">QueueingConsumer.Delivery delivery = consumer.nextDelivery();</div>
<div style="font-family:arial,sans-serif;font-size:13px">..</div><div style="font-family:arial,sans-serif;font-size:13px">..</div><div style="font-family:arial,sans-serif;font-size:13px">}</div><div><div><font face="arial, sans-serif">catch (ShutdownSignalException sse) {</font></div>
<div><br></div><div>// notify client about network disconnection</div><div>// check if connection and channel is open... if its open then this current thread is delayed for some time so that exchange, queue, binding and consumer are restored..</div>
<div><br></div><div><span style="font-family:arial,sans-serif">} catch (java.io.IOException ioe) {</span></div><div><br></div><div><font face="arial, sans-serif">}</font></div></div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">} // end of while</div></div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div></div><br>
</div>