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.When to use multiple listeners
Typical cases:- Internal and external endpoints with different security. For example,
PLAINTEXTfor internal services on a private network,SASL_SSLfor external clients over the public internet. - Kubernetes deployments with separate services. A
ClusterIPservice for in-cluster traffic and aLoadBalancerservice for external traffic, each mapped to a different listener. - Distinct client populations with different security requirements. For example, a legacy fleet on
SASL_PLAINTEXTmigrating gradually to a newSASL_SSLlistener.
Configure two listeners
Add each listener with its ownGATEWAY_LISTENER_<NAME>_* block. The example below defines an EXTERNAL listener with SNI routing and SASL_SSL, and an INTERNAL listener with port routing and PLAINTEXT.
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.Constraints
Some configuration stays global across all listeners:- Shared SSL keystore and truststore. All listeners share the same keystore and truststore. To serve different certificates per listener, include all of them in the global keystore — Gateway selects the right one based on SNI during the TLS handshake.
- Shared SASL mechanisms. All SASL listeners share the same set of enabled SASL mechanisms. You can’t enable different mechanisms per listener (for example,
OAUTHBEARER-only for external,PLAIN-only for internal). - Global security mode. All listeners share the same
GATEWAY_SECURITY_MODE. You can’t mixGATEWAY_MANAGEDandKAFKA_MANAGEDacross listeners. If your use case requires both modes, deploy separate Gateway instances. - Internal load balancing is global. Internal load balancing is a global setting. When enabled, all listeners have to share the same advertised host. If listeners have different advertised hosts, disable internal load balancing or Gateway will fail to start.
Verify the configuration
Gateway logs the computed configuration at startup, including all registered listeners, their ports and routing mechanisms. Check the startup logs:Computed configuration output. For the example above, the block lists both listeners (this output is from Gateway 3.20.0 and may change in later versions):
GATEWAY_LISTENER_<NAME>_<PROPERTY> naming pattern and that the listener name contains only alphanumeric characters.
Run a Kafka client against each listener to confirm the metadata response advertises the expected hostnames and ports for that listener.