Commit c08e2ada1ff87ae88b1e348c30755528ba4297f4
Committed by
Andrew Shvayka
1 parent
01bf53b7
remote js-executor: parameter added KAFKA_CLIENT_ID
Showing
3 changed files
with
4 additions
and
1 deletions
@@ -27,6 +27,7 @@ kafka: | @@ -27,6 +27,7 @@ kafka: | ||
27 | replication_factor: "TB_QUEUE_KAFKA_REPLICATION_FACTOR" | 27 | replication_factor: "TB_QUEUE_KAFKA_REPLICATION_FACTOR" |
28 | acks: "TB_KAFKA_ACKS" # -1 = all; 0 = no acknowledgments; 1 = only waits for the leader to acknowledge | 28 | acks: "TB_KAFKA_ACKS" # -1 = all; 0 = no acknowledgments; 1 = only waits for the leader to acknowledge |
29 | requestTimeout: "TB_QUEUE_KAFKA_REQUEST_TIMEOUT_MS" | 29 | requestTimeout: "TB_QUEUE_KAFKA_REQUEST_TIMEOUT_MS" |
30 | + compression: "TB_QUEUE_KAFKA_COMPRESSION" # gzip or uncompressed | ||
30 | topic_properties: "TB_QUEUE_KAFKA_JE_TOPIC_PROPERTIES" | 31 | topic_properties: "TB_QUEUE_KAFKA_JE_TOPIC_PROPERTIES" |
31 | use_confluent_cloud: "TB_QUEUE_KAFKA_USE_CONFLUENT_CLOUD" | 32 | use_confluent_cloud: "TB_QUEUE_KAFKA_USE_CONFLUENT_CLOUD" |
32 | client_id: "KAFKA_CLIENT_ID" #inject pod name to easy identify the client using /opt/kafka/bin/kafka-consumer-groups.sh | 33 | client_id: "KAFKA_CLIENT_ID" #inject pod name to easy identify the client using /opt/kafka/bin/kafka-consumer-groups.sh |
@@ -27,6 +27,7 @@ kafka: | @@ -27,6 +27,7 @@ kafka: | ||
27 | replication_factor: "1" | 27 | replication_factor: "1" |
28 | acks: "1" # -1 = all; 0 = no acknowledgments; 1 = only waits for the leader to acknowledge | 28 | acks: "1" # -1 = all; 0 = no acknowledgments; 1 = only waits for the leader to acknowledge |
29 | requestTimeout: "30000" # The default value in kafkajs is: 30000 | 29 | requestTimeout: "30000" # The default value in kafkajs is: 30000 |
30 | + compression: "gzip" # gzip or uncompressed | ||
30 | topic_properties: "retention.ms:604800000;segment.bytes:26214400;retention.bytes:104857600;partitions:100;min.insync.replicas:1" | 31 | topic_properties: "retention.ms:604800000;segment.bytes:26214400;retention.bytes:104857600;partitions:100;min.insync.replicas:1" |
31 | use_confluent_cloud: false | 32 | use_confluent_cloud: false |
32 | client_id: "kafkajs" #inject pod name to easy identify the client using /opt/kafka/bin/kafka-consumer-groups.sh | 33 | client_id: "kafkajs" #inject pod name to easy identify the client using /opt/kafka/bin/kafka-consumer-groups.sh |
@@ -24,6 +24,7 @@ const topicProperties = config.get('kafka.topic_properties'); | @@ -24,6 +24,7 @@ const topicProperties = config.get('kafka.topic_properties'); | ||
24 | const kafkaClientId = config.get('kafka.client_id'); | 24 | const kafkaClientId = config.get('kafka.client_id'); |
25 | const acks = Number(config.get('kafka.acks')); | 25 | const acks = Number(config.get('kafka.acks')); |
26 | const requestTimeout = Number(config.get('kafka.requestTimeout')); | 26 | const requestTimeout = Number(config.get('kafka.requestTimeout')); |
27 | +const compressionType = (config.get('kafka.requestTimeout') === "gzip") ? CompressionTypes.GZIP : CompressionTypes.None; | ||
27 | 28 | ||
28 | let kafkaClient; | 29 | let kafkaClient; |
29 | let kafkaAdmin; | 30 | let kafkaAdmin; |
@@ -38,7 +39,7 @@ function KafkaProducer() { | @@ -38,7 +39,7 @@ function KafkaProducer() { | ||
38 | { | 39 | { |
39 | topic: responseTopic, | 40 | topic: responseTopic, |
40 | acks: acks, | 41 | acks: acks, |
41 | - compression: CompressionTypes.GZIP, | 42 | + compression: compressionType, |
42 | messages: [ | 43 | messages: [ |
43 | { | 44 | { |
44 | key: scriptId, | 45 | key: scriptId, |