This is an automated email from the ASF dual-hosted git repository.
tabish121 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-protonj2.git
The following commit(s) were added to refs/heads/main by this push:
new 0fa5bbff PROTON-2923 Update the test driver code to use Netty 4.2 APIs
0fa5bbff is described below
commit 0fa5bbff5a6cbb57e88a77ffaabfdc6e0a5246b5
Author: Timothy Bish <[email protected]>
AuthorDate: Wed Oct 14 12:26:14 2026 -0400
PROTON-2923 Update the test driver code to use Netty 4.2 APIs
Use the current APIs for the event loops in the test driver code
---
.../qpid/protonj2/test/driver/netty/netty4/Netty4Client.java | 5 +++--
.../qpid/protonj2/test/driver/netty/netty4/Netty4Server.java | 7 ++++---
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git
a/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/netty/netty4/Netty4Client.java
b/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/netty/netty4/Netty4Client.java
index baef09ea..5da304d0 100644
---
a/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/netty/netty4/Netty4Client.java
+++
b/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/netty/netty4/Netty4Client.java
@@ -49,8 +49,9 @@ import io.netty.channel.ChannelOutboundHandlerAdapter;
import io.netty.channel.ChannelPromise;
import io.netty.channel.EventLoop;
import io.netty.channel.EventLoopGroup;
+import io.netty.channel.MultiThreadIoEventLoopGroup;
import io.netty.channel.SimpleChannelInboundHandler;
-import io.netty.channel.nio.NioEventLoopGroup;
+import io.netty.channel.nio.NioIoHandler;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.http.DefaultHttpHeaders;
import io.netty.handler.codec.http.FullHttpRequest;
@@ -172,7 +173,7 @@ public final class Netty4Client implements NettyClient {
}
}
- group = new NioEventLoopGroup(1);
+ group = new MultiThreadIoEventLoopGroup(1, NioIoHandler.newFactory());
bootstrap = new
Bootstrap().channel(NioSocketChannel.class).group(group);
bootstrap.handler(new ChannelInitializer<Channel>() {
@Override
diff --git
a/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/netty/netty4/Netty4Server.java
b/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/netty/netty4/Netty4Server.java
index bae6f674..b338eeae 100644
---
a/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/netty/netty4/Netty4Server.java
+++
b/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/netty/netty4/Netty4Server.java
@@ -54,8 +54,9 @@ import io.netty.channel.ChannelOption;
import io.netty.channel.ChannelOutboundHandlerAdapter;
import io.netty.channel.ChannelPromise;
import io.netty.channel.EventLoopGroup;
+import io.netty.channel.MultiThreadIoEventLoopGroup;
import io.netty.channel.SimpleChannelInboundHandler;
-import io.netty.channel.nio.NioEventLoopGroup;
+import io.netty.channel.nio.NioIoHandler;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.codec.http.DefaultFullHttpResponse;
import io.netty.handler.codec.http.FullHttpRequest;
@@ -249,8 +250,8 @@ public final class Netty4Server implements NettyServer {
public void start() throws Exception {
if (started.compareAndSet(false, true)) {
// Configure the server to basic NIO type channels
- bossGroup = new NioEventLoopGroup(1);
- workerGroup = new NioEventLoopGroup();
+ bossGroup = new MultiThreadIoEventLoopGroup(1,
NioIoHandler.newFactory());
+ workerGroup = new
MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());
ServerBootstrap server = new ServerBootstrap();
server.group(bossGroup, workerGroup);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]