@Internal public class KafkaPropertiesUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
copyProperties(Properties from,
Properties to) |
static void |
setClientIdPrefix(Properties properties,
String kafkaClusterId)
client.id is used for Kafka server side logging, see
https://docs.confluent.io/platform/current/installation/configuration/consumer-configs.html#consumerconfigs_client.id
|
public static void copyProperties(@Nonnull Properties from, @Nonnull Properties to)
public static void setClientIdPrefix(Properties properties, String kafkaClusterId)
Set client id prefix to avoid mbean collision warning logs. There are multiple instances of the AdminClient/KafkaConsumer so each instance requires a different client id (i.e. also per cluster).
Flink internally configures the clientId, making this the only way to customize the Kafka client id parameter.
If this is not done, we will encounter warning logs of the form:
WARN org.apache.kafka.common.utils.AppInfoParser [] - Error registering AppInfo mbean javax.management.InstanceAlreadyExistsException: kafka.consumer:type=app-info,id=null-enumerator-consumer
WARN org.apache.kafka.common.utils.AppInfoParser [] - Error registering AppInfo mbean javax.management.InstanceAlreadyExistsException: kafka.admin.client:type=app-info,id=null-enumerator-admin-client
Copyright © 2022–2024 The Apache Software Foundation. All rights reserved.