remote js-executor: parameter added KAFKA_CLIENT_ID
This commit is contained in:
parent
d25d13d7c0
commit
c9f3562b58
@ -27,6 +27,7 @@ kafka:
|
|||||||
replication_factor: "TB_QUEUE_KAFKA_REPLICATION_FACTOR"
|
replication_factor: "TB_QUEUE_KAFKA_REPLICATION_FACTOR"
|
||||||
topic_properties: "TB_QUEUE_KAFKA_JE_TOPIC_PROPERTIES"
|
topic_properties: "TB_QUEUE_KAFKA_JE_TOPIC_PROPERTIES"
|
||||||
use_confluent_cloud: "TB_QUEUE_KAFKA_USE_CONFLUENT_CLOUD"
|
use_confluent_cloud: "TB_QUEUE_KAFKA_USE_CONFLUENT_CLOUD"
|
||||||
|
client_id: "KAFKA_CLIENT_ID" #inject pod name to easy identify the client using /opt/kafka/bin/kafka-consumer-groups.sh
|
||||||
confluent:
|
confluent:
|
||||||
sasl:
|
sasl:
|
||||||
mechanism: "TB_QUEUE_KAFKA_CONFLUENT_SASL_MECHANISM"
|
mechanism: "TB_QUEUE_KAFKA_CONFLUENT_SASL_MECHANISM"
|
||||||
|
|||||||
@ -27,6 +27,7 @@ kafka:
|
|||||||
replication_factor: "1"
|
replication_factor: "1"
|
||||||
topic_properties: "retention.ms:604800000;segment.bytes:26214400;retention.bytes:104857600;partitions:100;min.insync.replicas:1"
|
topic_properties: "retention.ms:604800000;segment.bytes:26214400;retention.bytes:104857600;partitions:100;min.insync.replicas:1"
|
||||||
use_confluent_cloud: false
|
use_confluent_cloud: false
|
||||||
|
client_id: "kafkajs" #inject pod name to easy identify the client using /opt/kafka/bin/kafka-consumer-groups.sh
|
||||||
confluent:
|
confluent:
|
||||||
sasl:
|
sasl:
|
||||||
mechanism: "PLAIN"
|
mechanism: "PLAIN"
|
||||||
|
|||||||
@ -21,6 +21,7 @@ const config = require('config'),
|
|||||||
KafkaJsWinstonLogCreator = require('../config/logger').KafkaJsWinstonLogCreator;
|
KafkaJsWinstonLogCreator = require('../config/logger').KafkaJsWinstonLogCreator;
|
||||||
const replicationFactor = config.get('kafka.replication_factor');
|
const replicationFactor = config.get('kafka.replication_factor');
|
||||||
const topicProperties = config.get('kafka.topic_properties');
|
const topicProperties = config.get('kafka.topic_properties');
|
||||||
|
const kafkaClientId = config.get('kafka.client_id');
|
||||||
|
|
||||||
let kafkaClient;
|
let kafkaClient;
|
||||||
let kafkaAdmin;
|
let kafkaAdmin;
|
||||||
@ -62,6 +63,12 @@ function KafkaProducer() {
|
|||||||
logCreator: KafkaJsWinstonLogCreator
|
logCreator: KafkaJsWinstonLogCreator
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (kafkaClientId) {
|
||||||
|
kafkaConfig['clientId'] = kafkaClientId;
|
||||||
|
} else {
|
||||||
|
logger.warn('KAFKA_CLIENT_ID is undefined. Consider to define the env variable KAFKA_CLIENT_ID');
|
||||||
|
}
|
||||||
|
|
||||||
if (useConfluent) {
|
if (useConfluent) {
|
||||||
kafkaConfig['sasl'] = {
|
kafkaConfig['sasl'] = {
|
||||||
mechanism: config.get('kafka.confluent.sasl.mechanism'),
|
mechanism: config.get('kafka.confluent.sasl.mechanism'),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user