Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 24cb5a3

Browse files
authored
Merge pull request #3 from veshu/develop
changes for https://github.com/topcoder-platform/topcoder-x-receiver/…
2 parents d8dbfdf + 790fd8d commit 24cb5a3

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

utils/kafka.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,21 @@ class Kafka {
2525
}
2626

2727
send(message) {
28-
return this.producer.send({topic: config.TOPIC, message: {value: message}});
28+
const data = JSON.stringify({
29+
topic: config.TOPIC,
30+
originator: 'topcoder-x-receiver',
31+
timestamp: (new Date()).toISOString(),
32+
'mime-type': 'application/json',
33+
payload: {
34+
value: message
35+
}
36+
});
37+
return this.producer.send({
38+
topic: config.TOPIC,
39+
message: {
40+
value: data
41+
}
42+
});
2943
}
3044
}
3145

0 commit comments

Comments
 (0)