activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject git commit: https://issues.apache.org/jira/browse/AMQ-5350
Date Tue, 09 Sep 2014 14:59:39 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk 3afde7bac -> b2e6a4166


https://issues.apache.org/jira/browse/AMQ-5350

Don't link the AMQP max frame size to the TransportConnector
maxFrameSize value.

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

Branch: refs/heads/trunk
Commit: b2e6a41661c52f35259dba8a7a3c58934513b533
Parents: 3afde7b
Author: Timothy Bish <tabish121@gmail.com>
Authored: Tue Sep 9 10:59:11 2014 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Tue Sep 9 10:59:11 2014 -0400

----------------------------------------------------------------------
 .../transport/amqp/AmqpProtocolConverter.java        | 15 ++++-----------
 .../activemq/transport/amqp/AmqpWireFormat.java      | 12 +++++++++++-
 .../transport/amqp/JmsClientRequestResponseTest.java |  1 -
 3 files changed, 15 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/b2e6a416/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 71a4ad7..caf2083 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
@@ -125,19 +125,12 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
     public AmqpProtocolConverter(AmqpTransport transport) {
         this.amqpTransport = transport;
 
-        int maxFrameSize = AmqpWireFormat.DEFAULT_MAX_FRAME_SIZE;
-
-        // AMQ-4914 - Setting the max frame size to large stalls out the QPid
-        // client on sends or
-        // consume due to no session credit. Once fixed we should set this value
-        // using
         // the configured maxFrameSize on the URI.
-        // int maxFrameSize = transport.getWireFormat().getMaxFrameSize() >
-        // Integer.MAX_VALUE ?
-        // Integer.MAX_VALUE : (int)
-        // transport.getWireFormat().getMaxFrameSize();
+        int maxFrameSize = transport.getWireFormat().getMaxAmqpFrameSize();
+        if (maxFrameSize > AmqpWireFormat.NO_AMQP_MAX_FRAME_SIZE) {
+            this.protonTransport.setMaxFrameSize(maxFrameSize);
+        }
 
-        this.protonTransport.setMaxFrameSize(maxFrameSize);
         this.protonTransport.bind(this.protonConnection);
         this.protonConnection.collect(eventCollector);
         updateTracer();

http://git-wip-us.apache.org/repos/asf/activemq/blob/b2e6a416/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpWireFormat.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpWireFormat.java
b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpWireFormat.java
index 13a264a..779cb65 100644
--- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpWireFormat.java
+++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpWireFormat.java
@@ -34,10 +34,12 @@ import org.fusesource.hawtbuf.Buffer;
 
 public class AmqpWireFormat implements WireFormat {
 
-    public static final int DEFAULT_MAX_FRAME_SIZE = 1024 * 1024 * 1;
+    public static final long DEFAULT_MAX_FRAME_SIZE = Long.MAX_VALUE;
+    public static final int NO_AMQP_MAX_FRAME_SIZE = -1;
 
     private int version = 1;
     private long maxFrameSize = DEFAULT_MAX_FRAME_SIZE;
+    private int maxAmqpFrameSize = NO_AMQP_MAX_FRAME_SIZE;
 
     @Override
     public ByteSequence marshal(Object command) throws IOException {
@@ -116,4 +118,12 @@ public class AmqpWireFormat implements WireFormat {
     public void setMaxFrameSize(long maxFrameSize) {
         this.maxFrameSize = maxFrameSize;
     }
+
+    public int getMaxAmqpFrameSize() {
+        return maxAmqpFrameSize;
+    }
+
+    public void setMaxAmqpFrameSize(int maxAmqpFrameSize) {
+        this.maxAmqpFrameSize = maxAmqpFrameSize;
+    }
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/b2e6a416/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JmsClientRequestResponseTest.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JmsClientRequestResponseTest.java
b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JmsClientRequestResponseTest.java
index 2f68fa3..c79493a 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JmsClientRequestResponseTest.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JmsClientRequestResponseTest.java
@@ -39,7 +39,6 @@ import javax.jms.Topic;
 
 import org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl;
 import org.junit.After;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TestName;


Mime
View raw message