Sha256: baf3e625ff8879df692c616e1d6531adf78364ac85e3cf5f40c0c486dbdd3806
Contents?: true
Size: 347 Bytes
Versions: 38
Compression:
Stored size: 347 Bytes
Contents
# Consumes messages from a Kafka topic. require_relative "init" consumer = $kafka.consumer(group_id: "greetings-group") consumer.subscribe("greetings") num_messages = 0 trap("TERM") { consumer.stop } consumer.each_message do |message| num_messages += 1 if num_messages % 1000 == 0 puts "Processed #{num_messages} messages" end end
Version data entries
38 entries across 38 versions & 1 rubygems