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) { public void onAMQPException(IOException error) {
closedSocket = true; closedSocket = true;
if( !closing) { if( !closing ) {
System.out.println("AMQP client disconnected"); amqpTransport.sendToActiveMQ(error);
error.printStackTrace();
} else { } 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(Command command);
public void sendToActiveMQ(IOException command);
public void sendToAmqp(Object command) throws IOException; public void sendToAmqp(Object command) throws IOException;
public X509Certificate[] getPeerCertificates(); public X509Certificate[] getPeerCertificates();

View File

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