WaterDrop is a standalone gem that sends messages to Kafka easily with an extra validation layer. It is a part of the Karafka ecosystem.
It:
1.0+
and Ruby 3.1+
Karafka ecosystem components documentation, including WaterDrop, can be found here.
If you want to both produce and consume messages, please use Karafka. It integrates WaterDrop automatically.
To get started with WaterDrop:
producer = WaterDrop::Producer.new do |config| config.deliver = true config.kafka = { 'bootstrap.servers': 'localhost:9092', 'request.required.acks': 1 } end
# sync producing producer.produce_sync(topic: 'my-topic', payload: 'my message') # or for async producer.produce_async(topic: 'my-topic', payload: 'my message') # or in sync batches producer.produce_many_sync( [ { topic: 'my-topic', payload: 'my message'}, { topic: 'my-topic', payload: 'my message'} ] ) # and async batches producer.produce_many_async( [ { topic: 'my-topic', payload: 'my message'}, { topic: 'my-topic', payload: 'my message'} ] ) # transactions producer.transaction do producer.produce_async(topic: 'my-topic', payload: 'my message') producer.produce_async(topic: 'my-topic', payload: 'my message') end
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4