Avoid logging error messages when an AMQP client gracefully disconnects.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1437550 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2013-01-23 16:36:37 +00:00
parent 3602973cae
commit 0dfa5f483c
3 changed files with 15 additions and 11 deletions

View File

@ -270,11 +270,13 @@ class AmqpProtocolConverter {
public void onAMQPException(IOException error) {
closedSocket = true;
if( !closing) {
System.out.println("AMQP client disconnected");
error.printStackTrace();
if( !closing ) {
amqpTransport.sendToActiveMQ(error);
} else {
doClose();
try {
amqpTransport.stop();
} catch (Exception ignore) {
}
}
}

View File

@ -29,6 +29,8 @@ public interface AmqpTransport {
public void sendToActiveMQ(Command command);
public void sendToActiveMQ(IOException command);
public void sendToAmqp(Object command) throws IOException;
public X509Certificate[] getPeerCertificates();

View File

@ -72,18 +72,18 @@ public class AmqpTransportFilter extends TransportFilter implements AmqpTranspor
@Override
public void onException(IOException error) {
protocolConverter.lock.lock();
try {
protocolConverter.lock.lock();
try {
protocolConverter.onAMQPException(error);
} finally {
protocolConverter.lock.unlock();
}
protocolConverter.onAMQPException(error);
} finally {
super.onException(error);
protocolConverter.lock.unlock();
}
}
public void sendToActiveMQ(IOException error) {
super.onException(error);
}
public void onCommand(Object command) {
try {
if (trace) {