A Kafka wrapper library for Kafka Consumers and Producers, made in Typescript.
producer.sendMessages("another_new_topx", 0, "new_msg", new kafka.KeyedMessage('keyed', 'a keyed message'))
.then(value => {
console.log(value);
});
producer_create_topic.createTopic("another_new_topx", true, null)
.then(value => {
console.log(value);
});
.Consume(null, null);
high_producer.sendMessages("another_new_topx", new kafka.KeyedMessage('keyed', 'a keyed message'))
high_producer_create_topic.sendMessages("random_topic")
let new_comsumer_1 = consumerGroup.consumerInitiate('consumer1', 'another_new_topx');
new_comsumer_1.on('error', consumerGroup.onError);
new_comsumer_1.on('message', function () {
new_comsumer_1.close(true, function (error) {
console.log('consumer1 closed', error);
});
});
new_comsumer_2.on('error', consumerGroup.onError);
new_comsumer_2.on('message', consumerGroup.onMessage);
new_comsumer_2.on('connect', function () {
setTimeout(function () {
new_comsumer_2.close(true, function (error) {
console.log('consumer2 closed', error);
});
}, 25000);
});
let new_comsumer_3 = consumerGroup.consumerInitiate('consumer3', 'another_new_topx');
new_comsumer_3.on('error', consumerGroup.onError);
new_comsumer_3.on('message', consumerGroup.onMessage);
Not functional yet!
producer_stream.sendMessages("another_new_topx", new kafka.KeyedMessage('keyed', 'a keyed message'))