Repository: qpid-jms
Updated Branches:
  refs/heads/master 1baf3e2cb -> d5be8518e


QPIDJMS-401 Save allocation of new promise on each writeAndFlush

Use the Netty voidPromise instance owned by the channel to avoid allocation
of an unused promise on each write operation to the Transport.


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

Branch: refs/heads/master
Commit: d11e275b9db8dfcc96a658b915ab7786a0246aa3
Parents: 1baf3e2
Author: Francesco Nigro <nigro....@gmail.com>
Authored: Sun Jun 24 16:10:15 2018 +0200
Committer: Timothy Bish <tabish...@gmail.com>
Committed: Wed Jul 11 14:58:44 2018 -0400

----------------------------------------------------------------------
 .../org/apache/qpid/jms/transports/netty/NettyTcpTransport.java  | 4 ++--
 .../org/apache/qpid/jms/transports/netty/NettyWsTransport.java   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/d11e275b/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettyTcpTransport.java
----------------------------------------------------------------------
diff --git 
a/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettyTcpTransport.java
 
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettyTcpTransport.java
index ab04a75..3c02cc9 100644
--- 
a/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettyTcpTransport.java
+++ 
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettyTcpTransport.java
@@ -265,14 +265,14 @@ public class NettyTcpTransport implements Transport {
     public void write(ByteBuf output) throws IOException {
         checkConnected(output);
         LOG.trace("Attempted write of: {} bytes", output.readableBytes());
-        channel.write(output);
+        channel.write(output, channel.voidPromise());
     }
 
     @Override
     public void writeAndFlush(ByteBuf output) throws IOException {
         checkConnected(output);
         LOG.trace("Attempted write and flush of: {} bytes", 
output.readableBytes());
-        channel.writeAndFlush(output);
+        channel.writeAndFlush(output, channel.voidPromise());
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/d11e275b/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettyWsTransport.java
----------------------------------------------------------------------
diff --git 
a/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettyWsTransport.java
 
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettyWsTransport.java
index 034dfc3..3da8784 100644
--- 
a/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettyWsTransport.java
+++ 
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/transports/netty/NettyWsTransport.java
@@ -94,7 +94,7 @@ public class NettyWsTransport extends NettyTcpTransport {
 
         LOG.trace("Attempted write of: {} bytes", length);
 
-        channel.write(new BinaryWebSocketFrame(output));
+        channel.write(new BinaryWebSocketFrame(output), channel.voidPromise());
     }
 
     @Override
@@ -107,7 +107,7 @@ public class NettyWsTransport extends NettyTcpTransport {
 
         LOG.trace("Attempted write and flush of: {} bytes", length);
 
-        channel.writeAndFlush(new BinaryWebSocketFrame(output));
+        channel.writeAndFlush(new BinaryWebSocketFrame(output), 
channel.voidPromise());
     }
 
     @Override


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to