Class LayeredTenantConfigSource

java.lang.Object
io.confluent.kafka.multitenant.metadata.LayeredTenantConfigSource
All Implemented Interfaces:
org.apache.kafka.server.multitenant.TenantConfigSource

public class LayeredTenantConfigSource extends Object implements org.apache.kafka.server.multitenant.TenantConfigSource
A TenantConfigSource that composes multiple layers by priority.

Keys missing from every caller-supplied layer fall back to TenantConfig.CONFIG's defaultValues() — which acts as an implicit lowest-priority layer, so callers do not need (and should not) supply a "defaults" layer of their own.

Build instances via the fluent builder, which encodes layering direction at the call site:

LayeredTenantConfigSource source = LayeredTenantConfigSource
    .withBase(profileSource)
    .overriddenBy(cacheOverridesSource)
    .build();
  • Method Details

    • withBase

      public static LayeredTenantConfigSource.Builder withBase(org.apache.kafka.server.multitenant.TenantConfigSource base)
      Start a builder with base as the lowest-priority layer.
    • configFor

      public Optional<org.apache.kafka.server.multitenant.TenantConfig> configFor(String tenantId)
      Specified by:
      configFor in interface org.apache.kafka.server.multitenant.TenantConfigSource