Skip to content

Commit

Permalink
Merge pull request #60 from shikshalokam/kafkalogsChange
Browse files Browse the repository at this point in the history
kafka logs added
  • Loading branch information
aks30 authored Feb 2, 2022
2 parents e5a1f0f + a5710e4 commit 1f24bb2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/kafka.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ var _sendToKafkaConsumers = function (topic,host) {

consumer.on('message', async function (message) {

console.log("-------Kafka log starts here------------------");
console.log("Topic Name: ", topic);
console.log("Message: ", JSON.stringify(message));
console.log("-------Kafka log ends here------------------");

if (message && message.topic === SUBMISSION_TOPIC) {
submissionsConsumer.messageReceived(message);
Expand Down
5 changes: 5 additions & 0 deletions generics/kafka/producers.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ const pushMessageToKafka = function(payload) {
throw reject("Kafka configuration is not done");
}

console.log("-------Kafka log starts here------------------");
console.log("Topic Name: ", payload[0].topic);
console.log("Message: ", JSON.stringify(payload));
console.log("-------Kafka log ends here------------------");

kafkaClient.kafkaProducer.send(payload, (err, data) => {
if (err) {
return reject("Kafka push to topic "+ payload[0].topic +" failed.");
Expand Down

0 comments on commit 1f24bb2

Please sign in to comment.