activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject [2/2] activemq git commit: https://issues.apache.org/jira/browse/AMQ-5550
Date Thu, 05 Feb 2015 22:55:07 GMT
https://issues.apache.org/jira/browse/AMQ-5550

Ensure that the consumer and producer context instances are marked as
closed when creation at the broker end fails.


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/666f6f3b
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/666f6f3b
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/666f6f3b

Branch: refs/heads/activemq-5.11.x
Commit: 666f6f3b3fced9d3d9b6c24fc3769752330b5b40
Parents: 38994bd
Author: Timothy Bish <tabish121@gmail.com>
Authored: Fri Jan 30 10:35:35 2015 -0500
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Thu Feb 5 17:55:02 2015 -0500

----------------------------------------------------------------------
 .../activemq/transport/amqp/AmqpProtocolConverter.java | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/666f6f3b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
index 238b8b0..131df8f 100644
--- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
+++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
@@ -316,6 +316,9 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
 
                 Event event = null;
                 while ((event = eventCollector.peek()) != null) {
+                    if (amqpTransport.isTrace()) {
+                        LOG.trace("Processing event: {}", event.getType());
+                    }
                     switch (event.getType()) {
                         case CONNECTION_REMOTE_OPEN:
                         case CONNECTION_REMOTE_CLOSE:
@@ -761,6 +764,10 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
             }
         }
 
+        public void close() {
+            closed = true;
+        }
+
         public boolean isAnonymous() {
             return anonymous;
         }
@@ -898,7 +905,7 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
                     dest = createDestination(remoteTarget);
                 }
 
-                ProducerContext producerContext = new ProducerContext(producerId, dest, anonymous);
+                final ProducerContext producerContext = new ProducerContext(producerId, dest,
anonymous);
 
                 receiver.setContext(producerContext);
                 receiver.flow(flow);
@@ -916,7 +923,9 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
                             } else {
                                 receiver.setCondition(new ErrorCondition(AmqpError.INTERNAL_ERROR,
exception.getMessage()));
                             }
+                            producerContext.closed = true;
                             receiver.close();
+                            receiver.free();
                         } else {
                             receiver.open();
                         }
@@ -1423,7 +1432,9 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
                             sender.setCondition(new ErrorCondition(AmqpError.INTERNAL_ERROR,
exception.getMessage()));
                         }
                         subscriptionsByConsumerId.remove(id);
+                        consumerContext.closed = true;
                         sender.close();
+                        sender.free();
                     } else {
                         sessionContext.consumers.put(id, consumerContext);
                         sender.open();


Mime
View raw message