From 790fd8d9db222d3023ae92e271ac61f11eb68868 Mon Sep 17 00:00:00 2001 From: veshu Date: Sat, 7 Jul 2018 23:00:17 +0545 Subject: [PATCH] changes for https://github.com/topcoder-platform/topcoder-x-receiver/issues/2 --- utils/kafka.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/utils/kafka.js b/utils/kafka.js index 2885adb..965377a 100755 --- a/utils/kafka.js +++ b/utils/kafka.js @@ -25,7 +25,21 @@ class Kafka { } send(message) { - return this.producer.send({topic: config.TOPIC, message: {value: message}}); + const data = JSON.stringify({ + topic: config.TOPIC, + originator: 'topcoder-x-receiver', + timestamp: (new Date()).toISOString(), + 'mime-type': 'application/json', + payload: { + value: message + } + }); + return this.producer.send({ + topic: config.TOPIC, + message: { + value: data + } + }); } }