rdkafka
RxKafka - Reactive wrapper for well known C++ kafka library- Extending great library node rdkafka with reactive RxJs extension. Easy implementation using a simple Subscriptions to well known Observables and subscriptions from ReactiveX.
- Added Typescript for cleaner manipulation with API and configurations
Quick Start
Simple start consist only from 3 steps.
1. Install
npm i rxkafka
2. Configure Producer
; producer.send;
3. Configure Consumer
; consumer.connect.subscribe,;
Documentation
Some other examples of using RxKafka library with all possibilities of configuration.
Get watermark offset
consumer.watermarkOffsets.subscribe,;
Get Metadata
consumer.metadata.subscribe,;
Configuration
You can setup same configuration as explained in librdkafka configuration using prepared interfaces for easier usage.
Topic configuration:
Consumer configuration:
Producer configuration:
Shared configuration for Producer and also Consumer:
Metadata configuration:
Tatistics consumer configuration:
Run locally
Require git, docker
1. Clone dockerized kafka
git clone https://github.com/wurstmeister/kafka-docker.git
docker-compose-single-broker.yml
2. Configure file Override two settings
KAFKA_ADVERTISED_HOST_NAME: 192.168.99.100KAFKA_CREATE_TOPICS: "my-topic:1:1"
3. Run kafka as single broker
docker-compose -f docker-compose-single-broker.yml up -d
KafkaIntegrationTests.test.ts
4. Edit Remove skip
phase from tests (Skipped because of travis CI).
4. Execute tests
npm run test
Contributing
All contributors are welcome. If you never contributed to the open-source, start with reading the Github Flow.
- Create an issue
- Create a pull request with reference to the issue
- Rest and enjoy the great feeling of being a contributor.