Interface InboundChannelHandlerFactory


@Experimental public interface InboundChannelHandlerFactory
Custom netty inbound handler factory in order to make custom changes on netty inbound data. Good example usage of this API is custom authentication. When the user is not authenticated then the instantiated channel handler can send back 401 to trigger negotiation. Since implementations are loaded with service loader it's discouraged to store any internal state in factories.
  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler>
    createHandler(org.apache.flink.configuration.Configuration configuration, Map<String,String> responseHeaders)
    Creates new instance of ChannelHandler
    int
    Gives back priority of the ChannelHandler.
  • Method Details

    • priority

      int priority()
      Gives back priority of the ChannelHandler. The bigger the value is, the earlier it is executed. If multiple handlers have the same priority then the order is not defined.
      Returns:
      the priority of the ChannelHandler.
    • createHandler

      Optional<org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler> createHandler(org.apache.flink.configuration.Configuration configuration, Map<String,String> responseHeaders) throws org.apache.flink.util.ConfigurationException
      Creates new instance of ChannelHandler
      Parameters:
      configuration - The Flink Configuration.
      responseHeaders - The response headers.
      Returns:
      ChannelHandler or null if no custom handler need to be created.
      Throws:
      org.apache.flink.util.ConfigurationException - Thrown, if the handler configuration is incorrect.