Class NettyEventSenderFactory<T>
java.lang.Object
org.apache.nifi.event.transport.netty.EventLoopGroupFactory
org.apache.nifi.event.transport.netty.NettyEventSenderFactory<T>
- All Implemented Interfaces:
EventSenderFactory<T>
- Direct Known Subclasses:
ByteArrayNettyEventSenderFactory,StreamingNettyEventSenderFactory,StringNettyEventSenderFactory
public class NettyEventSenderFactory<T>
extends EventLoopGroupFactory
implements EventSenderFactory<T>
Netty Event Sender Factory
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate Durationprivate static final intprivate intprivate final intprivate final TransportProtocolprivate Durationprivate Durationprivate booleanprivate Integerprivate SSLContextprivate Duration -
Constructor Summary
ConstructorsConstructorDescriptionNettyEventSenderFactory(String address, int port, TransportProtocol protocol) -
Method Summary
Modifier and TypeMethodDescriptionprivate io.netty.channel.ChannelInitializer<io.netty.channel.Channel> private io.netty.channel.pool.ChannelPoolgetChannelPool(io.netty.bootstrap.Bootstrap bootstrap) private EventSender<T> getConfiguredEventSender(io.netty.bootstrap.Bootstrap bootstrap) Get Event Senderprivate voidsetChannelOptions(io.netty.bootstrap.Bootstrap bootstrap) voidsetHandlerSupplier(Supplier<List<io.netty.channel.ChannelHandler>> handlerSupplier) Set Channel Handler SuppliervoidsetIdleTimeout(Duration idleTimeout) Set the idle timeout period for outgoing client connectionsvoidsetMaxConnections(int maxConnections) Set Maximum Connections for Channel PoolvoidsetShutdownQuietPeriod(Duration quietPeriod) Set shutdown quiet periodvoidsetShutdownTimeout(Duration timeout) Set shutdown timeoutvoidsetSingleEventPerConnection(boolean singleEventPerConnection) Send a single event for the session and close the connection.voidsetSocketSendBufferSize(Integer socketSendBufferSize) Set Socket Send Buffer Size for TCP SocketsvoidsetSslContext(SSLContext sslContext) Set SSL Context to enable TLS Channel HandlervoidsetTimeout(Duration timeout) Set Timeout for Connections and CommunicationMethods inherited from class org.apache.nifi.event.transport.netty.EventLoopGroupFactory
getEventLoopGroup, setThreadNamePrefix, setWorkerThreads
-
Field Details
-
MAX_PENDING_ACQUIRES
private static final int MAX_PENDING_ACQUIRES- See Also:
-
socketSendBufferSize
-
address
-
port
private final int port -
protocol
-
timeout
-
idleTimeout
-
maxConnections
private int maxConnections -
handlerSupplier
-
sslContext
-
singleEventPerConnection
private boolean singleEventPerConnection -
shutdownQuietPeriod
-
shutdownTimeout
-
-
Constructor Details
-
NettyEventSenderFactory
-
-
Method Details
-
setSocketSendBufferSize
Set Socket Send Buffer Size for TCP Sockets- Parameters:
socketSendBufferSize- Send Buffer size can be null to use default setting
-
setHandlerSupplier
Set Channel Handler Supplier- Parameters:
handlerSupplier- Channel Handler Supplier
-
setSslContext
Set SSL Context to enable TLS Channel Handler- Parameters:
sslContext- SSL Context
-
setTimeout
Set Timeout for Connections and Communication- Parameters:
timeout- Timeout Duration
-
setIdleTimeout
Set the idle timeout period for outgoing client connections -
setShutdownQuietPeriod
Set shutdown quiet period- Parameters:
quietPeriod- shutdown quiet period
-
setShutdownTimeout
Set shutdown timeout- Parameters:
timeout- shutdown timeout
-
setMaxConnections
public void setMaxConnections(int maxConnections) Set Maximum Connections for Channel Pool- Parameters:
maxConnections- Maximum Number of connections defaults to available processors multiplied by 2
-
setSingleEventPerConnection
public void setSingleEventPerConnection(boolean singleEventPerConnection) Send a single event for the session and close the connection. Useful for endpoints which can not be configured to listen for a delimiter.- Parameters:
singleEventPerConnection- true if the connection should be ended after an event is sent
-
getEventSender
Description copied from interface:EventSenderFactoryGet Event Sender- Specified by:
getEventSenderin interfaceEventSenderFactory<T>- Returns:
- Event Sender
-
setChannelOptions
private void setChannelOptions(io.netty.bootstrap.Bootstrap bootstrap) -
getConfiguredEventSender
-
getChannelPool
private io.netty.channel.pool.ChannelPool getChannelPool(io.netty.bootstrap.Bootstrap bootstrap) -
getChannelInitializer
private io.netty.channel.ChannelInitializer<io.netty.channel.Channel> getChannelInitializer()
-