A modern Apacha Kafka client for node.js coupled with Avro support
This library combines Kafka.js and Avsc to provide seamless and unopinionated avro encoding/decoding for your kafka messages using a minimum of dependencies.
subject:"<subject>"/* [Extra setting] Avro subject to send */,
version:
"latest"/* [Extra setting] Version of the avro subject to send */,
value:{value:1}/* Your message value object to send */
}
]
})
})()
Underlying features from Kafka.js
All features from Kafka.js are preserved and adapted. Take a look at the Kafka.js project to see what's available. All extra settings and variables required by this library are highlighted with [Extra setting] on the examples.
Avro schema cache
Requests to the avro registry are minimised by locally caching schemas.
The module KafkaAvro is an extension of Kafka that requires a few more keys to construct and offers all Kafka functions under KafkaAvro.avro in a modified version that seemlessly handles avro encoding and decoding.
Types
This library uses typescript. This means that you'll see what functions are available to you and what keys are required to invoke a function or construct an instance class.