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 Details

    • MAX_PENDING_ACQUIRES

      private static final int MAX_PENDING_ACQUIRES
      See Also:
    • socketSendBufferSize

      private Integer socketSendBufferSize
    • address

      private final String address
    • port

      private final int port
    • protocol

      private final TransportProtocol protocol
    • timeout

      private Duration timeout
    • idleTimeout

      private Duration idleTimeout
    • maxConnections

      private int maxConnections
    • handlerSupplier

      private Supplier<List<io.netty.channel.ChannelHandler>> handlerSupplier
    • sslContext

      private SSLContext sslContext
    • singleEventPerConnection

      private boolean singleEventPerConnection
    • shutdownQuietPeriod

      private Duration shutdownQuietPeriod
    • shutdownTimeout

      private Duration shutdownTimeout
  • Constructor Details

  • Method Details

    • setSocketSendBufferSize

      public void setSocketSendBufferSize(Integer socketSendBufferSize)
      Set Socket Send Buffer Size for TCP Sockets
      Parameters:
      socketSendBufferSize - Send Buffer size can be null to use default setting
    • setHandlerSupplier

      public void setHandlerSupplier(Supplier<List<io.netty.channel.ChannelHandler>> handlerSupplier)
      Set Channel Handler Supplier
      Parameters:
      handlerSupplier - Channel Handler Supplier
    • setSslContext

      public void setSslContext(SSLContext sslContext)
      Set SSL Context to enable TLS Channel Handler
      Parameters:
      sslContext - SSL Context
    • setTimeout

      public void setTimeout(Duration timeout)
      Set Timeout for Connections and Communication
      Parameters:
      timeout - Timeout Duration
    • setIdleTimeout

      public void setIdleTimeout(Duration idleTimeout)
      Set the idle timeout period for outgoing client connections
    • setShutdownQuietPeriod

      public void setShutdownQuietPeriod(Duration quietPeriod)
      Set shutdown quiet period
      Parameters:
      quietPeriod - shutdown quiet period
    • setShutdownTimeout

      public void setShutdownTimeout(Duration timeout)
      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

      public EventSender<T> getEventSender()
      Description copied from interface: EventSenderFactory
      Get Event Sender
      Specified by:
      getEventSender in interface EventSenderFactory<T>
      Returns:
      Event Sender
    • setChannelOptions

      private void setChannelOptions(io.netty.bootstrap.Bootstrap bootstrap)
    • getConfiguredEventSender

      private EventSender<T> getConfiguredEventSender(io.netty.bootstrap.Bootstrap bootstrap)
    • getChannelPool

      private io.netty.channel.pool.ChannelPool getChannelPool(io.netty.bootstrap.Bootstrap bootstrap)
    • getChannelInitializer

      private io.netty.channel.ChannelInitializer<io.netty.channel.Channel> getChannelInitializer()