activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1437550 - in /activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp: AmqpProtocolConverter.java AmqpTransport.java AmqpTransportFilter.java
Date Wed, 23 Jan 2013 16:36:38 GMT
Author: chirino
Date: Wed Jan 23 16:36:37 2013
New Revision: 1437550

URL: http://svn.apache.org/viewvc?rev=1437550&view=rev
Log:
Avoid logging error messages when an AMQP client gracefully disconnects.

Modified:
    activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
    activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpTransport.java
    activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpTransportFilter.java

Modified: activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java?rev=1437550&r1=1437549&r2=1437550&view=diff
==============================================================================
--- activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
(original)
+++ activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
Wed Jan 23 16:36:37 2013
@@ -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) {
+            }
         }
     }
 

Modified: activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpTransport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpTransport.java?rev=1437550&r1=1437549&r2=1437550&view=diff
==============================================================================
--- activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpTransport.java
(original)
+++ activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpTransport.java
Wed Jan 23 16:36:37 2013
@@ -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();

Modified: activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpTransportFilter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpTransportFilter.java?rev=1437550&r1=1437549&r2=1437550&view=diff
==============================================================================
--- activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpTransportFilter.java
(original)
+++ activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpTransportFilter.java
Wed Jan 23 16:36:37 2013
@@ -72,18 +72,18 @@ public class AmqpTransportFilter extends
 
     @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) {



Mime
View raw message