With this module, it is possible to have a fine grained control over which Kafka topics and event names the client can subscribe to. There could be multiple event names associated for the same message. Internally message events are emitted to local listeners using Node.js Events, which decode protobuf messages and execute the intended listeners.
This client includes a Provider object, which packages events and distributes them to the respective listeners. Currently, the following event providers are implemented:
- Local (in-process events, designed for testing)
When subscribing to a given event name, options can be passed. Currently, the supported subscription options are:
startingOffset- value for the starting offset to process messages; default is
queue- a boolean flag; if set to
true, messages are queued and processed synchronously;
forceOffset- a boolean flag; if set to
startingOffsetis considered above any other provided offset or configuration parameter.
- To run tests
npm run test
- Install dependencies
# compile the codenpm run build