Commit c94dc5972e875d8d22f85c5ad0b236e6aa0e680d

Authored by Sergey Matvienko
Committed by Andrew Shvayka
1 parent a569058c

remote js-executor: parameter added TB_KAFKA_ACKS="1"

... ... @@ -88,7 +88,7 @@ JsInvokeMessageProcessor.prototype.onJsInvokeMessage = function(message) {
88 88 logger.error(err.stack);
89 89 }
90 90 }
91   - logger.warn('[%s] SLOW PROCESSING [%s]ms, functionName [%s], request: ', requestId, tTook, functionName);
  91 + logger.warn('[%s] SLOW PROCESSING [%s]ms, functionName [%s]', requestId, tTook, functionName);
92 92 if (slowQueryLogBody) {
93 93 logger.info('Slow request body: %s', JSON.stringify(request, null, 4))
94 94 }
... ...
... ... @@ -25,6 +25,7 @@ kafka:
25 25 # Kafka Bootstrap Servers
26 26 servers: "TB_KAFKA_SERVERS"
27 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 29 topic_properties: "TB_QUEUE_KAFKA_JE_TOPIC_PROPERTIES"
29 30 use_confluent_cloud: "TB_QUEUE_KAFKA_USE_CONFLUENT_CLOUD"
30 31 client_id: "KAFKA_CLIENT_ID" #inject pod name to easy identify the client using /opt/kafka/bin/kafka-consumer-groups.sh
... ...
... ... @@ -13,7 +13,7 @@
13 13 * See the License for the specific language governing permissions and
14 14 * limitations under the License.
15 15 */
16   -const {logLevel, Kafka} = require('kafkajs');
  16 +const {logLevel, Kafka, CompressionTypes} = require('kafkajs');
17 17
18 18 const config = require('config'),
19 19 JsInvokeMessageProcessor = require('../api/jsInvokeMessageProcessor'),
... ... @@ -22,6 +22,7 @@ const config = require('config'),
22 22 const replicationFactor = config.get('kafka.replication_factor');
23 23 const topicProperties = config.get('kafka.topic_properties');
24 24 const kafkaClientId = config.get('kafka.client_id');
  25 +const acks = config.get('kafka.acks');
25 26
26 27 let kafkaClient;
27 28 let kafkaAdmin;
... ... @@ -35,6 +36,7 @@ function KafkaProducer() {
35 36 return producer.send(
36 37 {
37 38 topic: responseTopic,
  39 + acks: acks,
38 40 messages: [
39 41 {
40 42 key: scriptId,
... ...