Sha256: 59238a3ceede2bcca673bd64eda6200aa3783785a8ec219f43cf3746e5301317
Contents?: true
Size: 462 Bytes
Versions: 38
Compression:
Stored size: 462 Bytes
Contents
# Continuously produces messages to a Kafka topic. require_relative "init" producer = $kafka.async_producer( delivery_interval: 1, max_queue_size: 5_000, max_buffer_size: 10_000, ) num_messages = 0 shutdown = false trap("TERM") { shutdown = true } until shutdown begin producer.produce("hello", key: "world", topic: "greetings") rescue Kafka::BufferOverflow puts "Buffer overflow, backing off..." sleep 10 end end producer.shutdown
Version data entries
38 entries across 38 versions & 1 rubygems