{"repo":"zendesk/delivery_boy","free":true,"listed":false,"github":"https://github.com/zendesk/delivery_boy","clone":"git clone https://github.com/zendesk/delivery_boy.git","description":"A simple way to publish messages to Kafka from Ruby applications","language":"Ruby","stars":236,"topics":["ruby","kafka","kafka-producer"],"license":"Apache-2.0","category":"data-pipelines","readme_excerpt":"DeliveryBoy This library provides a dead easy way to start publishing messages to a Kafka cluster from your Ruby or Rails application! Installation Add this line to your application's Gemfile: And then execute: $ bundle Or install it yourself as: $ gem install delivery boy Usage Once you've installed the gem, and assuming your Kafka broker is running on localhost, you can simply start publishing messages to Kafka directly from your Rails code: The above example will block the server process until the message has been delivered. If you want deliveries to happen in the background in order to free up your server processes more quickly, call #deliver async instead: In addition to improving response time, delivering messages asynchronously also protects your application against Kafka availability issues -- if messages cannot be delivered, they'll be buffered for later and retried automatically. A third method is to produce messages first (without delivering the messages to Kafka yet), and deliver them synchronously later. The methods deliver , deliver async and produce take the following options: topic – the Kafka topic that should be written to (required). key – the key that should be set on the Kafka message (optional). partition – a specific partition number that should be written to (optional). partition key – a string that can be used to deterministically select the partition that should be written to (optional). Regarding partition and partition key : if none are specified, ","default_branch":null,"files":null,"tree":[],"storefront":"/r/zendesk","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/zendesk/delivery_boy/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}