Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit 5cc79c7

Browse files
committed
Added a messsage key to distribute payloads evenly among distinct partitions
1 parent 736ce78 commit 5cc79c7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/logstash/outputs/kafka.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require 'zlib'
12
require 'logstash/namespace'
23
require 'logstash/outputs/base'
34

@@ -136,7 +137,7 @@ def register
136137

137138
@codec.on_event do |event|
138139
begin
139-
@producer.send_msg(@topic_id,nil,event)
140+
@producer.send_msg(@topic_id, Zlib::crc32(event).to_s, event)
140141
rescue LogStash::ShutdownSignal
141142
@logger.info('Kafka producer got shutdown signal')
142143
rescue => e

0 commit comments

Comments
 (0)