Skip to main content
To configure Conduktor Gateway, we recommend setting up environment variables. They can be set in the Gateway container or taken from a file. To make sure the values were set correctly, check the startup logs.

Use the Gateway container

You can set the environment variables during the docker-run command with -e or --env:
Or in a docker-compose.yaml:

Use a file

You can mount a file with the key-value pairs into the container and provide its path by setting the environment variable GATEWAY_ENV_FILE. Note these variables should be exported by the file as they are injected in the wrapper that starts the Gateway process.
Example
You’ll get a confirmation in the logs: Sourcing environment variables from $GATEWAY_ENV_FILE (or a warning if the file isn’t found: Warning: GATEWAY_ENV_FILE is set but the file does not exist or is not readable.).

Listeners

Per-listener configuration with GATEWAY_LISTENER_<NAME>_* variables is available from Gateway 3.20.0. On earlier versions, networking is configured with the global variables described in Legacy network configuration. To move an existing deployment over, see Migrate to listener configuration.
Configure listeners using the pattern GATEWAY_LISTENER_<NAME>_<PROPERTY>, where <NAME> is a label you choose. See Configure Gateway listeners for details.
Listener names have to start with a letter and contain only alphanumeric characters. Underscores are reserved as delimiters in GATEWAY_LISTENER_<NAME>_<PROPERTY>, so a name like MY_LISTENER would be ambiguous. Gateway only recognizes variables whose <NAME> matches this pattern — variables using any other name are ignored, and the listener is silently not created.
The following global variable applies to all listeners that use port routing:

Listeners: port specification format

GATEWAY_LISTENER_<NAME>_PORTS accepts ranges, individual values, or a combination of both, separated by commas:
When the advertised ports differ from the local ports (for example, behind a NAT or in Docker), use the advertised:local format:
You can mix ranges and individual ports with local mappings. For example, with GATEWAY_MIN_BROKERID=0 and three brokers:
For SNI routing, the listener uses a single port; the advertised:local format maps the advertised port (for example, a load balancer’s 443) to the local one:

Listeners: SSL client authentication modes

The GATEWAY_LISTENER_<NAME>_SSL_CLIENT_AUTH setting controls whether the Gateway requests a client certificate during the TLS handshake for a specific listener:
When SSL_CLIENT_AUTH is set to OPTIONAL or REQUIRE, you must configure a truststore in sslConfig.trustStore containing the CA certificates used to verify client certificates.

Listeners: zero-config mode

If you don’t set any listener or networking environment variables, Gateway configures itself automatically. It creates a single listener named DEFAULT with port routing, assigning ports from 6969 (one per broker, plus two for headroom), and takes the listener’s security protocol from the backing Kafka cluster. GATEWAY_ACL_ENABLED defaults to false in this mode. When GATEWAY_SECURITY_MODE is not set, Gateway infers it from the backing cluster’s security protocol:
Zero-config mode is for local development and testing only. Configure your listeners, security mode and ACLs explicitly for production deployments.

Listeners: legacy configuration (deprecated)

These global variables are deprecated in favor of per-listener configuration. They remain supported for now. For how they behave, see Legacy network configuration; to switch, see Migrate to listener configuration.

Load balancing

Connect Gateway to Kafka

Conduktor Gateway’s connection to Kafka is configured by the KAFKA_ environment variables. When translating Kafka’s properties, use upper case instead and replace the . with _. For example: When defining Gateway’s Kafka property bootstrap.servers, declare it as the environment variable KAFKA_BOOTSTRAP_SERVERS. Any variable prefixed with KAFKA_ will be treated as a connection parameter by Gateway.

Connection pooling

Cluster switch failover

Setting up your Kafka clusters for failover is similar to the standard setup, but you need to provide two sets of properties: one for your main cluster and one for your failover cluster. You can define these properties as environment variables or load a cluster configuration file.

Security and authentication

These global settings determine where authentication and authorization take place, and how clients authenticate. The security protocol itself is set per listener — see Listeners.
Set the security protocol clients use to connect to Gateway per listener, with GATEWAY_LISTENER_<NAME>_SECURITY_PROTOCOL (see Listeners). The global GATEWAY_SECURITY_PROTOCOL and its deprecated DELEGATED_* values apply only to legacy network configuration.

SSL authentication

The keystore and truststore are shared across all listeners. mTLS client authentication is set per listener with GATEWAY_LISTENER_<NAME>_SSL_CLIENT_AUTH — the global GATEWAY_SSL_CLIENT_AUTH applies only to legacy network configuration.
Password values (GATEWAY_SSL_KEY_STORE_PASSWORD, GATEWAY_SSL_KEY_PASSWORD, GATEWAY_SSL_TRUST_STORE_PASSWORD) support any characters except a literal single-quote ('). Pattern: [^']*

OAuthbearer

Some of these definitions (e.g. SASL_OAUTHBEARER_JWKS_ENDPOINT_REFRESH) are taken from Kafka documentation .

Principal resolver

Find out more about the principal resolver.

Plain authentication

Security provider

HTTP API

Password values (GATEWAY_HTTPS_KEY_STORE_PASSWORD, GATEWAY_HTTPS_TRUST_STORE_PASSWORD) support any characters except a literal single-quote ('). Pattern: [^']*

Feature flags

Topic ID support (preview)

Gateway supports topic-ID based Kafka protocol handling. Initial coverage is limited to the Fetch API: when disabled (default), Gateway advertises Fetch up to v12 during ApiVersions negotiation to force topic-name fetches; when enabled, clients can negotiate Fetch v13 or higher. Additional APIs will land behind the same flag in upcoming releases. Enable by setting GATEWAY_FEATURE_FLAGS_TOPIC_ID_SUPPORT=true. You can’t enable it at the same time as incremental fetch sessions — Gateway doesn’t start when both flags are set.
This is a preview feature. We recommend enabling it only in non-production environments.

Incremental fetch sessions (preview)

Apache Kafka clients can use incremental fetch sessions (KIP-227) to make Fetch requests smaller: a consumer opens a session with a first, full Fetch request, then sends only the partitions that changed on each later request while the broker tracks the rest. When you enable this flag, Gateway supports these sessions through the proxy. Enable by setting GATEWAY_FEATURE_FLAGS_INCREMENTAL_FETCH_SESSIONS_ENABLED=true.
This is a preview feature. We recommend enabling it only in non-production environments.

Incompatibilities

  • Topic ID support: you can’t combine incremental fetch sessions with topic ID support. Gateway doesn’t start when both GATEWAY_FEATURE_FLAGS_INCREMENTAL_FETCH_SESSIONS_ENABLED and GATEWAY_FEATURE_FLAGS_TOPIC_ID_SUPPORT are set to true. Disable one of them.
  • SQL and CEL topics: these deprecated logical topics are incompatible with incremental fetch sessions and return incorrect results when it’s enabled. Topic views aren’t affected.
If you use the audit Interceptor or a fetch policy, enabling incremental fetch sessions changes how they behave. See those pages for details.

Licensing

Monitoring

Audit

GATEWAY_AUDIT_LOG_EVENT_TYPES valid value is ALL (default) or a comma-separated list of the following:
  • CONNECTION for initial connection event, i.e. receiving Kafka’s API_VERSIONS request
  • AUTHENTICATION for authentication success or failure event
  • REST_API for all REST v1 admin requests and all REST v2 requests (see API reference)
  • ACL_ADMIN for ACL management events done via Kafka Admin API, i.e. CREATE_ACLS and DELETE_ACLS requests
  • AUTHORIZATION for authorization failure events, i.e. when ACL permissions deny an operation on a resource
Find out more about Gateway audit event types, including Kafka API key auditing.

Logging

Product analytics

Advanced configuration

These settings are for advanced tuning and debugging. Most deployments don’t need to change them.

Threading

Gateway internal timeout

These timeout thresholds are used by Gateway and typically don’t need modification since they match Apache Kafka’s defaults. If your Kafka brokers or clients use non-default timeout values, you may want to adjust these.

Graceful shutdown

During shutdown, Gateway closes client connections in controlled manner to simulate rolling Kafka broker restart, with GATEWAY_SHUTDOWN_DELAY_BETWEEN_BROKERS_MS pause between brokers. For librdkafka clients, set GATEWAY_SHUTDOWN_DELAY_BETWEEN_BROKERS_MS to 1000 or higher to prevent them from crashing during shutdown because of ALL_BROKERS_DOWN error.

Internal topics

As Gateway is stateless, it uses Kafka topics to store its internal state. Use the following environment variables to configure these internal topics. If missing, Gateway will automatically create the topics (if it has the permission to do so). You can also create the topics independently of Gateway, just make sure they are configured as described below.

Internal state

Firstly, there are some general configuration settings for Gateway internal state management which apply to all used topics.

Topic names

Required topic configuration

The most important setting is log.cleanup.policy which defines the clean up policy for the topic. Most of the topics used by Gateway are compacted, but some use time-based retention. If this isn’t set up properly, Gateway will throw an error on startup. Set the following:
  • log.cleanup.policy=compact for compaction
  • log.cleanup.policy=delete for time based retention
If Gateway creates the topics for you, it will set the right values. The second vital setting is the replication factor. This should be set to at least 3 in production environments to ensure that the data is safe (Gateway will warn you on startup, if it’s set to less than three). When creating topics, Gateway uses the default value for your Kafka brokers for this setting. For partition count, most of the topics are low volume and can operate well with only a single partition. This isn’t enforced (Gateway will work with multi partition topics for internal state), however there is no need to have more than one partition. The exception to this is the audit log topic which can have a lot of events written to it, if enabled for a busy cluster. We recommend starting with 3 partitions for audit logs (this doesn’t affect Gateway performance as it is a writer, not a reader), but will impact any other consumers you may run reading from it.

Data Quality topic configs

API blocking modes

The GATEWAY_FEATURE_FLAGS_BLOCK_UNSUPPORTED_APIS environment variable controls how Gateway handles Kafka APIs that aren’t explicitly supported. Two modes:
  • Permissive mode (false, default): Gateway allows unsupported APIs to pass through - maintains backward compatibility
  • Restrictive mode (true): Gateway blocks unsupported APIs for enhanced security
When to use each:
  • Use permissive (default) when upgrading or if you have legacy applications
  • Use restrictive when you want maximum security and only allow known, supported APIs
Impact of each mode: Permissive mode (false):
  • Backward compatibility: Legacy applications continue to work
  • Smooth upgrades: No breaking changes during Gateway updates
  • ⚠️ Security risk: Unsupported APIs bypass Gateway’s security controls
Restrictive mode (true):
  • Enhanced security: Only explicitly supported APIs are allowed
  • Controlled environment: Prevents access to potentially problematic APIs
  • Breaking changes: Applications using unsupported APIs will fail
APIs not supported by Gateway: Gateway categorizes unsupported APIs into two groups:
  1. Stability-blocked APIs (always blocked):
  • Stability (APIs not yet fully implemented or tested in Gateway):
  • DESCRIBE_TOPIC_PARTITIONS - New API for describing topic partitions
  • CONSUMER_GROUP_DESCRIBE - New consumer group protocol API (KIP-848)
  • CONSUMER_GROUP_HEARTBEAT - New consumer group protocol API (KIP-848)
  • New Kafka 4 group protocols (Gateway has no rebuilder for these, so it blocks them for every client):
  • Share groups (KIP-932), also known as Kafka queues: SHARE_GROUP_HEARTBEAT, SHARE_GROUP_DESCRIBE, SHARE_FETCH, SHARE_ACKNOWLEDGE, INITIALIZE_SHARE_GROUP_STATE, READ_SHARE_GROUP_STATE, WRITE_SHARE_GROUP_STATE, DELETE_SHARE_GROUP_STATE, READ_SHARE_GROUP_STATE_SUMMARY, DESCRIBE_SHARE_GROUP_OFFSETS, ALTER_SHARE_GROUP_OFFSETS, DELETE_SHARE_GROUP_OFFSETS
  • Streams groups (KIP-1071), the new Kafka Streams rebalance protocol: STREAMS_GROUP_HEARTBEAT, STREAMS_GROUP_DESCRIBE
  • Admin operations (these operations should be performed directly on the underlying Kafka cluster rather than through Gateway):
  • ALTER_REPLICA_LOG_DIRS - Admin operation for altering replica log directories
  • ELECT_LEADERS - Admin operation for leader election
  • ALTER_PARTITION_REASSIGNMENTS - Admin operation for partition reassignments
  • LIST_PARTITION_REASSIGNMENTS - Admin operation for listing partition reassignments
  • ALTER_PARTITION - Admin operation for altering partitions
  • ALLOCATE_PRODUCER_IDS - Admin operation for producer ID allocation
  • CREATE_DELEGATION_TOKEN - Admin operation for creating delegation tokens
  • RENEW_DELEGATION_TOKEN - Admin operation for renewing delegation tokens
  • EXPIRE_DELEGATION_TOKEN - Admin operation for expiring delegation tokens
  • DESCRIBE_DELEGATION_TOKEN - Admin operation for describing delegation tokens
  • DESCRIBE_USER_SCRAM_CREDENTIALS - Admin operation for describing SCRAM credentials
  • ALTER_USER_SCRAM_CREDENTIALS - Admin operation for altering SCRAM credentials
  • DESCRIBE_CLIENT_QUOTAS - Admin operation for describing client quotas
  • ALTER_CLIENT_QUOTAS - Admin operation for altering client quotas
  • UPDATE_FEATURES - Admin operation for updating cluster features
  1. Unknown/Unsupported APIs (affected by this setting):
  • KIP-1000 Configuration APIs (bypass ACL checks):
    • LIST_CLIENT_METRICS_RESOURCES (KIP-1000) - List client metrics configuration resources without DESCRIBE_CONFIGS permission
  • Internal/Admin APIs (not meant for client use):
    • LEADER_AND_ISR - Internal leader election and ISR management
    • STOP_REPLICA - Internal replica management
    • UPDATE_METADATA - Internal metadata updates
    • CONTROLLED_SHUTDOWN - Internal broker shutdown coordination
    • WRITE_TXN_MARKERS - Internal transaction marker management
    • DESCRIBE_QUORUM - Internal quorum management
    • ENVELOPE - Internal request envelope handling
    • UNREGISTER_BROKER - Internal broker registration management
    • ADD_RAFT_VOTER - Internal Raft consensus management
    • REMOVE_RAFT_VOTER - Internal Raft consensus management
  • Future Kafka APIs not yet implemented in Gateway
  • Any other APIs that may bypass Gateway’s security controls or don’t work correctly with Gateway features
Security implications: When GATEWAY_FEATURE_FLAGS_BLOCK_UNSUPPORTED_APIS=false (permissive mode):
  • Unsupported APIs are passed through to Kafka without Gateway processing
  • Configuration exposure: KIP-1000 APIs allow access to sensitive configuration without proper permissions
  • Internal API access: Internal/Admin APIs meant for broker-to-broker communication may be accessible to clients
  • Topic mapping and other Gateway features may not work correctly
  • Potential for unauthorized access to restricted resources and information disclosure
The KIP-932 share-group and KIP-1071 streams-group APIs are not affected by this setting — Gateway always blocks them, in both modes. When GATEWAY_FEATURE_FLAGS_BLOCK_UNSUPPORTED_APIS=true (restrictive mode):
  • All unsupported APIs are blocked at the Gateway level
  • Prevents security vulnerabilities: Blocks KIP-1000 APIs that bypass ACL checks
  • Prevents internal API access: Blocks internal/Admin APIs that should not be accessible to clients
  • Enhanced security through explicit allow-list approach
  • Applications must use only Gateway-supported APIs
Example of problematic situation: ListClientMetricsResources API bypasses ACL checks: When GATEWAY_FEATURE_FLAGS_BLOCK_UNSUPPORTED_APIS=false (permissive mode), clients can call the ListClientMetricsResources API without proper authorization. This API is designed to list all client metrics configuration resources in the cluster. Attack scenario:
  1. Unauthorized client connects to Gateway without DESCRIBE_CONFIGS permission on CLUSTER resource
  2. Client calls ListClientMetricsResources API directly
  3. Gateway forwards the request to Kafka without ACL validation (since it’s not in the supported APIs list)
  4. Kafka responds with complete list of client metrics configuration resources
  5. Client receives sensitive configuration information including:
    • All configured client metrics resources
    • Internal cluster configuration details
    • Resource names and configurations that should be protected
Security impact:
  • Information disclosure: Unauthorized access to sensitive cluster configuration
  • ACL bypass: Complete circumvention of Gateway’s permission system
  • Compliance violation: Access to restricted data without proper authorization
  • Reconnaissance: Attackers can enumerate cluster resources for further attacks
Why this happens: The ListClientMetricsResources API is not included in Gateway’s supported APIs list, so when permissive mode is enabled, it bypasses all Gateway security controls and is forwarded directly to Kafka without ACL validation.
This setting only affects unsupported APIs. APIs that are explicitly blocked for security or stability reasons (like consumer group management) will always be blocked, regardless of this setting.

Low-level network configuration

These variables should not be changed without consulting the Conduktor support team. They allow tuning and debugging uncommon network behavior.