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

Commit 39a5786

Browse files
committed
change for #2
1 parent e4f6b23 commit 39a5786

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/utils/kafka.js

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

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

0 commit comments

Comments
 (0)