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

Commit 790fd8d

Browse files
committed
changes for #2
1 parent 7202c43 commit 790fd8d

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)