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 | 27 | replication_factor: "TB_QUEUE_KAFKA_REPLICATION_FACTOR" |
28 | 28 | acks: "TB_KAFKA_ACKS" # -1 = all; 0 = no acknowledgments; 1 = only waits for the leader to acknowledge |
29 | 29 | requestTimeout: "TB_QUEUE_KAFKA_REQUEST_TIMEOUT_MS" |
30 | + compression: "TB_QUEUE_KAFKA_COMPRESSION" # gzip or uncompressed | |
30 | 31 | topic_properties: "TB_QUEUE_KAFKA_JE_TOPIC_PROPERTIES" |
31 | 32 | use_confluent_cloud: "TB_QUEUE_KAFKA_USE_CONFLUENT_CLOUD" |
32 | 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 | 27 | replication_factor: "1" |
28 | 28 | acks: "1" # -1 = all; 0 = no acknowledgments; 1 = only waits for the leader to acknowledge |
29 | 29 | requestTimeout: "30000" # The default value in kafkajs is: 30000 |
30 | + compression: "gzip" # gzip or uncompressed | |
30 | 31 | topic_properties: "retention.ms:604800000;segment.bytes:26214400;retention.bytes:104857600;partitions:100;min.insync.replicas:1" |
31 | 32 | use_confluent_cloud: false |
32 | 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 | 24 | const kafkaClientId = config.get('kafka.client_id'); |
25 | 25 | const acks = Number(config.get('kafka.acks')); |
26 | 26 | const requestTimeout = Number(config.get('kafka.requestTimeout')); |
27 | +const compressionType = (config.get('kafka.requestTimeout') === "gzip") ? CompressionTypes.GZIP : CompressionTypes.None; | |
27 | 28 | |
28 | 29 | let kafkaClient; |
29 | 30 | let kafkaAdmin; |
... | ... | @@ -38,7 +39,7 @@ function KafkaProducer() { |
38 | 39 | { |
39 | 40 | topic: responseTopic, |
40 | 41 | acks: acks, |
41 | - compression: CompressionTypes.GZIP, | |
42 | + compression: compressionType, | |
42 | 43 | messages: [ |
43 | 44 | { |
44 | 45 | key: scriptId, | ... | ... |