Class SystemEnvPropertyOverrides
- All Implemented Interfaces:
KafkaPropertyOverrides
Variables can either target a specific cluster name or be common across all clusters.
Common variables, not targeted at a specific cluster, or where the service only accesses a
single cluster (which is the most common pattern), should have variable names in the format:
KAFKA_<PROPERTY_NAME>
where:
- PROPERTY_NAME is Kafka client property name, in uppercase, with periods
.
replaced with underscores_
For example, config boostrap.servers
can be set with a variable name of
KAFKA_BOOTSTRAP_SERVERS
.
In the unusual situation that a service access multiple Kafka clusters, a variable can target
at a specific Kafka cluster. Such variables should have a name in the format:
KAFKA_<CLUSTER_NAME>_<PROPERTY_NAME>
where:
- CLUSTER_NAME is the specific name of the Kafka cluster, as returned by
KafkaTopicDescriptor.cluster()
), in uppercase and any dashes-
replaced with underscores_
. - PROPERTY_NAME is Kafka client property name, in uppercase, with periods
.
replaced with underscores_
For example, config boostrap.servers
for the main-cluster
cluster can be set
with a variable name of KAFKA_MAIN_CLUSTER_BOOTSTRAP_SERVERS
.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Get Kafka client property overrides for a cluster.int
hashCode()
void
Initialize the overrides providerstatic KafkaPropertyOverrides
Factory method
-
Method Details
-
systemEnvPropertyOverrides
Factory method- Returns:
- kafka overrides.
-
init
Description copied from interface:KafkaPropertyOverrides
Initialize the overrides provider- Specified by:
init
in interfaceKafkaPropertyOverrides
- Parameters:
clusterNames
- the set of known Kafka cluster names.
-
get
Description copied from interface:KafkaPropertyOverrides
Get Kafka client property overrides for a cluster.- Specified by:
get
in interfaceKafkaPropertyOverrides
- Parameters:
clusterName
- the name of the cluster to get the overrides for.- Returns:
- property overrides.
-
equals
-
hashCode
public int hashCode()
-