Skip to content

Commit 77ff321

Browse files
committed
ARTEMIS-5734 upgrade to Netty 4.2.7.Final
1 parent 1c1924c commit 77ff321

File tree

22 files changed

+87
-95
lines changed

22 files changed

+87
-95
lines changed

artemis-commons/src/test/java/org/apache/activemq/artemis/utils/ByteUtilTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ public void shouldZeroesDirectByteBuffer() {
223223

224224
@Test
225225
public void shouldZeroesLimitedDirectByteBuffer() {
226+
assumeTrue(PlatformDependent.hasUnsafe());
226227
final byte one = (byte) 1;
227228
final int capacity = 64;
228229
final int bytes = 32;

artemis-core-client-osgi/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<Import-Package>
7171
org.glassfish.json*;resolution:=optional,
7272
de.dentrassi.crypto.pem;resolution:=optional,
73-
io.netty.buffer;io.netty.*;version="[4.1,5)",
73+
io.netty.*;version="[4.2,5)",
7474
*
7575
</Import-Package>
7676
<_exportcontents>org.apache.activemq.artemis.*;-noimport:=true</_exportcontents>

artemis-core-client/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,6 @@
109109
<groupId>io.netty</groupId>
110110
<artifactId>netty-handler-proxy</artifactId>
111111
</dependency>
112-
<dependency>
113-
<groupId>io.netty</groupId>
114-
<artifactId>netty-codec</artifactId>
115-
</dependency>
116112
<dependency>
117113
<groupId>io.netty</groupId>
118114
<artifactId>netty-codec-socks</artifactId>

artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616
*/
1717
package org.apache.activemq.artemis.core.remoting.impl.netty;
1818

19-
import static org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.NETTY_HTTP_HEADER_PREFIX;
20-
2119
import javax.net.ssl.SNIHostName;
2220
import javax.net.ssl.SSLContext;
2321
import javax.net.ssl.SSLEngine;
2422
import javax.net.ssl.SSLParameters;
2523
import java.io.IOException;
24+
import java.lang.invoke.MethodHandles;
2625
import java.net.ConnectException;
2726
import java.net.InetAddress;
2827
import java.net.InetSocketAddress;
@@ -63,15 +62,16 @@
6362
import io.netty.channel.ChannelPipeline;
6463
import io.netty.channel.ChannelPromise;
6564
import io.netty.channel.EventLoopGroup;
65+
import io.netty.channel.MultiThreadIoEventLoopGroup;
6666
import io.netty.channel.SimpleChannelInboundHandler;
6767
import io.netty.channel.WriteBufferWaterMark;
68-
import io.netty.channel.epoll.EpollEventLoopGroup;
68+
import io.netty.channel.epoll.EpollIoHandler;
6969
import io.netty.channel.epoll.EpollSocketChannel;
7070
import io.netty.channel.group.ChannelGroup;
7171
import io.netty.channel.group.DefaultChannelGroup;
72-
import io.netty.channel.kqueue.KQueueEventLoopGroup;
72+
import io.netty.channel.kqueue.KQueueIoHandler;
7373
import io.netty.channel.kqueue.KQueueSocketChannel;
74-
import io.netty.channel.nio.NioEventLoopGroup;
74+
import io.netty.channel.nio.NioIoHandler;
7575
import io.netty.channel.socket.nio.NioSocketChannel;
7676
import io.netty.handler.codec.base64.Base64;
7777
import io.netty.handler.codec.http.DefaultFullHttpRequest;
@@ -92,11 +92,11 @@
9292
import io.netty.handler.codec.http.LastHttpContent;
9393
import io.netty.handler.codec.http.cookie.ClientCookieDecoder;
9494
import io.netty.handler.codec.http.cookie.Cookie;
95-
import io.netty.handler.ssl.SslContext;
9695
import io.netty.handler.codec.socksx.SocksVersion;
9796
import io.netty.handler.proxy.ProxyHandler;
9897
import io.netty.handler.proxy.Socks4ProxyHandler;
9998
import io.netty.handler.proxy.Socks5ProxyHandler;
99+
import io.netty.handler.ssl.SslContext;
100100
import io.netty.handler.ssl.SslHandler;
101101
import io.netty.resolver.NoopAddressResolverGroup;
102102
import io.netty.util.AttributeKey;
@@ -128,8 +128,8 @@
128128
import org.apache.activemq.artemis.utils.PasswordMaskingUtil;
129129
import org.slf4j.Logger;
130130
import org.slf4j.LoggerFactory;
131-
import java.lang.invoke.MethodHandles;
132131

132+
import static org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.NETTY_HTTP_HEADER_PREFIX;
133133
import static org.apache.activemq.artemis.utils.Base64.encodeBytes;
134134

135135
public class NettyConnector extends AbstractConnector {
@@ -537,29 +537,29 @@ public synchronized void start() {
537537

538538
if (useEpoll && CheckDependencies.isEpollAvailable()) {
539539
if (useGlobalWorkerPool) {
540-
group = SharedEventLoopGroup.getInstance((threadFactory -> new EpollEventLoopGroup(remotingThreads, threadFactory)));
540+
group = SharedEventLoopGroup.getInstance((threadFactory -> new MultiThreadIoEventLoopGroup(remotingThreads, threadFactory, EpollIoHandler.newFactory())));
541541
} else {
542-
group = new EpollEventLoopGroup(remotingThreads);
542+
group = new MultiThreadIoEventLoopGroup(remotingThreads, EpollIoHandler.newFactory());
543543
}
544544
connectorType = EPOLL_CONNECTOR_TYPE;
545545
channelClazz = EpollSocketChannel.class;
546546
logger.debug("Connector {} using native epoll", this);
547547
} else if (useKQueue && CheckDependencies.isKQueueAvailable()) {
548548
if (useGlobalWorkerPool) {
549-
group = SharedEventLoopGroup.getInstance((threadFactory -> new KQueueEventLoopGroup(remotingThreads, threadFactory)));
549+
group = SharedEventLoopGroup.getInstance((threadFactory -> new MultiThreadIoEventLoopGroup(remotingThreads, threadFactory, KQueueIoHandler.newFactory())));
550550
} else {
551-
group = new KQueueEventLoopGroup(remotingThreads);
551+
group = new MultiThreadIoEventLoopGroup(remotingThreads, KQueueIoHandler.newFactory());
552552
}
553553
connectorType = KQUEUE_CONNECTOR_TYPE;
554554
channelClazz = KQueueSocketChannel.class;
555555
logger.debug("Connector {} using native kqueue", this);
556556
} else {
557557
if (useGlobalWorkerPool) {
558558
channelClazz = NioSocketChannel.class;
559-
group = SharedEventLoopGroup.getInstance((threadFactory -> new NioEventLoopGroup(remotingThreads, threadFactory)));
559+
group = SharedEventLoopGroup.getInstance((threadFactory -> new MultiThreadIoEventLoopGroup(remotingThreads, threadFactory, NioIoHandler.newFactory())));
560560
} else {
561561
channelClazz = NioSocketChannel.class;
562-
group = new NioEventLoopGroup(remotingThreads);
562+
group = new MultiThreadIoEventLoopGroup(remotingThreads, NioIoHandler.newFactory());
563563
}
564564
connectorType = NIO_CONNECTOR_TYPE;
565565
channelClazz = NioSocketChannel.class;

artemis-features/src/main/resources/features.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
<bundle>mvn:io.netty/netty-resolver/${netty.version}</bundle>
3434
<bundle>mvn:io.netty/netty-transport/${netty.version}</bundle>
3535
<bundle>mvn:io.netty/netty-buffer/${netty.version}</bundle>
36-
<bundle>mvn:io.netty/netty-codec/${netty.version}</bundle>
36+
<bundle>mvn:io.netty/netty-codec-base/${netty.version}</bundle>
37+
<bundle>mvn:io.netty/netty-codec-compression/${netty.version}</bundle>
3738
<bundle>mvn:io.netty/netty-codec-socks/${netty.version}</bundle>
3839
<bundle>mvn:io.netty/netty-codec-haproxy/${netty.version}</bundle>
3940
<bundle>mvn:io.netty/netty-codec-http/${netty.version}</bundle>

artemis-jms-client-osgi/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
<Import-Package>
7979
org.glassfish.json*;resolution:=optional,
8080
de.dentrassi.crypto.pem;resolution:=optional,
81-
io.netty.buffer;io.netty.*;version="[4.1,5)",
81+
io.netty.*;version="[4.2,5)",
8282
*
8383
</Import-Package>
8484
<_exportcontents>org.apache.activemq.artemis.*;-noimport:=true</_exportcontents>

artemis-pom/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,6 @@
412412
<version>${netty.version}</version>
413413
<!-- License: Apache 2.0 -->
414414
</dependency>
415-
<dependency>
416-
<groupId>io.netty</groupId>
417-
<artifactId>netty-codec</artifactId>
418-
<version>${netty.version}</version>
419-
<!-- License: Apache 2.0 -->
420-
</dependency>
421415
<dependency>
422416
<groupId>io.netty</groupId>
423417
<artifactId>netty-codec-http</artifactId>

artemis-protocols/artemis-jakarta-openwire-protocol/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@
9090
<groupId>io.netty</groupId>
9191
<artifactId>netty-transport</artifactId>
9292
</dependency>
93-
<dependency>
94-
<groupId>io.netty</groupId>
95-
<artifactId>netty-codec</artifactId>
96-
</dependency>
9793
<dependency>
9894
<groupId>org.osgi</groupId>
9995
<artifactId>osgi.cmpn</artifactId>

artemis-protocols/artemis-mqtt-protocol/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@
6969
<groupId>io.netty</groupId>
7070
<artifactId>netty-transport</artifactId>
7171
</dependency>
72-
<dependency>
73-
<groupId>io.netty</groupId>
74-
<artifactId>netty-codec</artifactId>
75-
</dependency>
7672
<dependency>
7773
<groupId>io.netty</groupId>
7874
<artifactId>netty-common</artifactId>

artemis-protocols/artemis-openwire-protocol/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@
9696
<groupId>io.netty</groupId>
9797
<artifactId>netty-transport</artifactId>
9898
</dependency>
99-
<dependency>
100-
<groupId>io.netty</groupId>
101-
<artifactId>netty-codec</artifactId>
102-
</dependency>
10399
<dependency>
104100
<groupId>org.osgi</groupId>
105101
<artifactId>osgi.cmpn</artifactId>

0 commit comments

Comments
 (0)