Class KafkaClusterConfig
java.lang.Object
io.kroxylicious.testing.kafka.common.KafkaClusterConfig
The Kafka cluster config class.
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe type Config holder. - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionCluster id string.static KafkaClusterConfigfromConstraints(List<Annotation> annotations, TestInfo testInfo) Build the cluster constraints from the supplied list of annotations.generateConfigForSpecificNode(KafkaListenerSource kafkaListenerSource, int nodeId) Get a broker configs for a specificnode.id.getAnonConnectConfigForCluster(String bootstrapServers) Generates client connection config to connect to the anonymous listeners within the cluster.getBrokerConfigs(Supplier<KafkaListenerSource> listenerSourceSupplier) Gets broker configs.getConnectConfigForCluster(String bootstrapServers) Generates client connection config to connect to the cluster via the supplied bootstrap address.getConnectConfigForCluster(String bootstrapServers, String user, String password) Generates client connection config to connect to the cluster via the supplied bootstrap address and user credentials.getConnectConfigForCluster(String bootstrapServers, String user, String password, String securityProtocol, String saslMechanism) Generates client connection config to connect to the cluster via the supplied bootstrap address and authentication configuration.getControllerAdminClientConfigForCluster(String bootstrapControllers) Generates client connection config to connect to the cluster via the supplied controller bootstrap address.Optional<org.apache.kafka.clients.admin.ScramMechanism> booleanbooleanIs the cluster coppering using Kraft Controller nodes.booleanstatic booleansupportsConstraint(Class<? extends Annotation> annotation) Does the KafkaClusterConfiguration support the supplied constraint. 
- 
Constructor Details
- 
KafkaClusterConfig
public KafkaClusterConfig() 
 - 
 - 
Method Details
- 
supportsConstraint
Does the KafkaClusterConfiguration support the supplied constraint.- Parameters:
 annotation- the annotation- Returns:
 - the boolean
 
 - 
fromConstraints
Build the cluster constraints from the supplied list of annotations.- Parameters:
 annotations- the annotations used to configure the KafkaClustertestInfo- information about the test execution context.- Returns:
 - the kafka cluster config
 
 - 
getBrokerConfigs
public Stream<KafkaClusterConfig.ConfigHolder> getBrokerConfigs(Supplier<KafkaListenerSource> listenerSourceSupplier) Gets broker configs.- Parameters:
 listenerSourceSupplier- the end point config supplier- Returns:
 - the broker configs
 
 - 
generateConfigForSpecificNode
@NonNull public KafkaClusterConfig.ConfigHolder generateConfigForSpecificNode(KafkaListenerSource kafkaListenerSource, int nodeId) Get a broker configs for a specificnode.id.- Parameters:
 kafkaListenerSource- the end point confignodeId- kafkanode.id- Returns:
 - broker configuration.
 
 - 
getAnonConnectConfigForCluster
Generates client connection config to connect to the anonymous listeners within the cluster. Thus bypassing all authentication mechanisms.- Parameters:
 bootstrapServers- the bootstrap servers- Returns:
 - the anon connect config for cluster
 
 - 
getConnectConfigForCluster
Generates client connection config to connect to the cluster via the supplied bootstrap address.- Parameters:
 bootstrapServers- the bootstrap servers- Returns:
 - the connect config for cluster
 
 - 
getConnectConfigForCluster
public Map<String,Object> getConnectConfigForCluster(String bootstrapServers, String user, String password) Generates client connection config to connect to the cluster via the supplied bootstrap address and user credentials.- Parameters:
 bootstrapServers- the bootstrap serversuser- the userpassword- the password- Returns:
 - the connect config for cluster
 
 - 
getConnectConfigForCluster
public Map<String,Object> getConnectConfigForCluster(String bootstrapServers, String user, String password, String securityProtocol, String saslMechanism) Generates client connection config to connect to the cluster via the supplied bootstrap address and authentication configuration.- Parameters:
 bootstrapServers- the bootstrap serversuser- the userpassword- the passwordsecurityProtocol- the security protocolsaslMechanism- the sasl mechanism- Returns:
 - the connect config for cluster
 
 - 
getControllerAdminClientConfigForCluster
Generates client connection config to connect to the cluster via the supplied controller bootstrap address. This method is applicable to KRaft clusters only.- Parameters:
 bootstrapControllers- controller bootstrap- Returns:
 - the connect config for cluster
 
 - 
isSaslScram
public boolean isSaslScram() - 
getScramMechanism
 - 
isKraftMode
public boolean isKraftMode()Is the cluster coppering using Kraft Controller nodes.- Returns:
 - true if kraft mode is used, false otherwise
 
 - 
clusterId
Cluster id string.- Returns:
 - the id
 
 - 
isKafkaVersion41OrHigher
public boolean isKafkaVersion41OrHigher() 
 -