ChannelBuilders Utility

ChannelBuilders utility is used for the following:

Creating ChannelBuilder (for Kafka Clients and Inter-Broker Communication) — clientChannelBuilder Method

ChannelBuilder clientChannelBuilder(
  SecurityProtocol securityProtocol,
  JaasContext.Type contextType,
  AbstractConfig config,
  ListenerName listenerName,
  String clientSaslMechanism,
  Time time,
  boolean saslHandshakeRequestEnable)

clientChannelBuilder…​FIXME

Note

clientChannelBuilder is used when:

serverChannelBuilder Method

ChannelBuilder serverChannelBuilder(
  ListenerName listenerName,
  boolean isInterBrokerListener,
  SecurityProtocol securityProtocol,
  AbstractConfig config,
  CredentialCache credentialCache,
  DelegationTokenCache tokenCache,
  Time time)

serverChannelBuilder…​FIXME

Note
serverChannelBuilder is used when Processor is created (and creates a Selector).

Creating KafkaPrincipalBuilder Per principal.builder.class Configuration Property — createPrincipalBuilder Utility

KafkaPrincipalBuilder createPrincipalBuilder(
  Map<String, ?> configs,
  TransportLayer transportLayer,
  Authenticator authenticator,
  KerberosShortNamer kerberosShortNamer,
  SslPrincipalMapper sslPrincipalMapper)

createPrincipalBuilder reads the principal.builder.class configuration property and creates a KafkaPrincipalBuilder:

  • For no class defined (null), createPrincipalBuilder creates a DefaultKafkaPrincipalBuilder (with the KerberosShortNamer and SslPrincipalMapper)

  • For a KafkaPrincipalBuilder implementation, createPrincipalBuilder creates an instance

  • For a PrincipalBuilder implementation, createPrincipalBuilder creates an instance

For a builder that is also a Configurable, createPrincipalBuilder requests it to configure (with the given configs).

createPrincipalBuilder throws an InvalidConfigurationException for any other implementation:

Type [principalBuilderClassName] is not an instance of org.apache.kafka.common.security.auth.PrincipalBuilder or org.apache.kafka.common.security.auth.KafkaPrincipalBuilder
Note
createPrincipalBuilder is used for creating the Authenticators (i.e. PlaintextAuthenticator, SslAuthenticator, and SaslServerAuthenticator).

create Internal Utility

ChannelBuilder create(
  SecurityProtocol securityProtocol,
  Mode mode,
  JaasContext.Type contextType,
  AbstractConfig config,
  ListenerName listenerName,
  boolean isInterBrokerListener,
  String clientSaslMechanism,
  boolean saslHandshakeRequestEnable,
  CredentialCache credentialCache,
  DelegationTokenCache tokenCache,
  Time time)

create…​FIXME

Note
create is used when ChannelBuilders utility is requested to clientChannelBuilder (CLIENT mode) and serverChannelBuilder (SERVER mode).

results matching ""

    No results matching ""