From fcb70f3f60fd4c3eaf8b2fe3fdf11f0b82d91655 Mon Sep 17 00:00:00 2001 From: Paul Gallagher Date: Mon, 10 Oct 2016 12:35:25 +0100 Subject: [PATCH] ARTEMIS-779 upgrade to netty 4.1.5.Final --- .../impl/netty/PartialPooledByteBufAllocator.java | 5 +++++ artemis-distribution/pom.xml | 2 +- artemis-distribution/src/main/assembly/dep.xml | 1 - artemis-protocols/artemis-mqtt-protocol/pom.xml | 19 +------------------ .../core/protocol/mqtt/MQTTProtocolHandler.java | 2 +- .../core/protocol/mqtt/MQTTProtocolManager.java | 2 +- pom.xml | 9 +-------- tests/integration-tests/pom.xml | 2 +- 8 files changed, 11 insertions(+), 31 deletions(-) diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/PartialPooledByteBufAllocator.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/PartialPooledByteBufAllocator.java index aeede30dab..d6b9251c3e 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/PartialPooledByteBufAllocator.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/PartialPooledByteBufAllocator.java @@ -130,4 +130,9 @@ public CompositeByteBuf compositeDirectBuffer(int maxNumComponents) { public boolean isDirectBufferPooled() { return true; } + + @Override + public int calculateNewCapacity(int minNewCapacity, int maxCapacity) { + return UNPOOLED.calculateNewCapacity(minNewCapacity, maxCapacity); + } } diff --git a/artemis-distribution/pom.xml b/artemis-distribution/pom.xml index 36c219e738..46203e8c2e 100644 --- a/artemis-distribution/pom.xml +++ b/artemis-distribution/pom.xml @@ -186,7 +186,7 @@ io.netty - netty-codec-mqtt + netty-all org.apache.geronimo.specs diff --git a/artemis-distribution/src/main/assembly/dep.xml b/artemis-distribution/src/main/assembly/dep.xml index a50fe79081..d21f1e0d6f 100644 --- a/artemis-distribution/src/main/assembly/dep.xml +++ b/artemis-distribution/src/main/assembly/dep.xml @@ -92,7 +92,6 @@ commons-collections:commons-collections org.fusesource.hawtbuf:hawtbuf org.jgroups:jgroups - io.netty:netty-codec-mqtt org.apache.geronimo.specs:geronimo-json_1.0_spec org.apache.johnzon:johnzon-core diff --git a/artemis-protocols/artemis-mqtt-protocol/pom.xml b/artemis-protocols/artemis-mqtt-protocol/pom.xml index 2260d51481..2349e16e57 100644 --- a/artemis-protocols/artemis-mqtt-protocol/pom.xml +++ b/artemis-protocols/artemis-mqtt-protocol/pom.xml @@ -46,7 +46,7 @@ io.netty - netty-codec-mqtt + netty-all junit @@ -54,21 +54,4 @@ - - - - org.apache.felix - maven-bundle-plugin - 3.0.0 - true - - - netty-codec-mqtt - !* - io.netty.*;version="[4,6)", * - - - - - diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java index 5d73f576ed..80923e9b3c 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java @@ -170,7 +170,7 @@ void disconnect() { void sendConnack(MqttConnectReturnCode returnCode) { MqttFixedHeader fixedHeader = new MqttFixedHeader(MqttMessageType.CONNACK, false, MqttQoS.AT_MOST_ONCE, false, 0); - MqttConnAckVariableHeader varHeader = new MqttConnAckVariableHeader(returnCode); + MqttConnAckVariableHeader varHeader = new MqttConnAckVariableHeader(returnCode, true); MqttConnAckMessage message = new MqttConnAckMessage(fixedHeader, varHeader); ctx.write(message); diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java index f8bdf2aacd..1f435ff686 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java @@ -111,7 +111,7 @@ public void handleBuffer(RemotingConnection connection, ActiveMQBuffer buffer) { @Override public void addChannelHandlers(ChannelPipeline pipeline) { - pipeline.addLast(new MqttEncoder()); + pipeline.addLast(MqttEncoder.INSTANCE); pipeline.addLast(new MqttDecoder(MQTTUtil.MAX_MESSAGE_SIZE)); pipeline.addLast(new MQTTProtocolHandler(server, this)); diff --git a/pom.xml b/pom.xml index 319132e244..5a05c4f46e 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ 9.3.10.v20160621 3.6.9.Final 2.4 - 4.0.39.Final + 4.1.5.Final 0.12.2 3.0.17.Final 1.7.12 @@ -400,12 +400,6 @@ - io.netty - netty-codec-mqtt - 5.0.0.Alpha2 - - - org.apache.qpid proton-j ${proton.version} diff --git a/tests/integration-tests/pom.xml b/tests/integration-tests/pom.xml index ced7814f06..9ba87dc562 100644 --- a/tests/integration-tests/pom.xml +++ b/tests/integration-tests/pom.xml @@ -184,7 +184,7 @@ io.netty - netty-codec-mqtt + netty-all