Class TestNettyClient
java.lang.Object
org.apache.kafka.common.network.netty.TestNettyClient
A simple Netty client for testing purposes.
It can connect to either UDS or TCP server, send messages, and receive responses.
The client uses a configurable
EventLoopGroup and ChannelHandler.
Subclasses can override the channelOptions() method to provide custom channel options.-
Constructor Summary
ConstructorsConstructorDescriptionTestNettyClient(io.netty.channel.ChannelHandler channelHandler) TestNettyClient(io.netty.channel.EventLoopGroup group) TestNettyClient(io.netty.channel.EventLoopGroup group, io.netty.channel.ChannelHandler channelHandler) -
Method Summary
Modifier and TypeMethodDescriptionio.netty.channel.Channelchannel()voidconnect(SocketAddress address) voidsendMessage(String message) voidshutdown()
-
Constructor Details
-
TestNettyClient
public TestNettyClient() -
TestNettyClient
public TestNettyClient(io.netty.channel.EventLoopGroup group) -
TestNettyClient
public TestNettyClient(io.netty.channel.ChannelHandler channelHandler) -
TestNettyClient
public TestNettyClient(io.netty.channel.EventLoopGroup group, io.netty.channel.ChannelHandler channelHandler)
-
-
Method Details
-
connect
- Throws:
InterruptedException
-
channel
public io.netty.channel.Channel channel() -
sendMessage
- Throws:
InterruptedException
-
getReceivedMessages
-
shutdown
public void shutdown()
-