You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var consumer = new Kafka.SimpleConsumer();
// data handler function can return a Promise
var dataHandler = function(messageSet, topic, partition) {
messageSet.forEach(function(m) {
const random = Math.floor(Math.random() * 11);
if (random > 5) {
console.log(topic, partition, m.offset, m.message.value.toString("utf8"));
} else {
// Decline a message
console.log("Decline a message");
}
});
};
return consumer.init().then(function() {
// Subscribe partitons 0 and 1 in a topic:
return consumer.subscribe("kafka-test-topic", [0, 1], dataHandler);
});
The text was updated successfully, but these errors were encountered:
By default in no-kafka there is a tentative configuration that defaults to 3.
How can I manually decline a message?
The text was updated successfully, but these errors were encountered: