Skip to content

Commit

Permalink
set the key on the kafka message (#12)
Browse files Browse the repository at this point in the history
This was publishing messages to kafka with an empty key but we should be using the message's key.
  • Loading branch information
rubyist authored Nov 10, 2023
1 parent a2ca9ba commit 96083f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/kafkaesque/clients/brod_client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ defmodule Kafkaesque.Clients.BrodClient do
@impl Kafkaesque.Client
def publish(%{brod_client_id: client_id, task_supervisor: task_supervisor}, messages) do
# We pre-process the message bodies to avoid copying unecessary data to the task
message_batches = Enum.group_by(messages, &{&1.partition, &1.topic}, &{"", &1.body})
message_batches = Enum.group_by(messages, &{&1.partition, &1.topic}, &{&1.key, &1.body})

task_results =
task_supervisor
Expand Down

0 comments on commit 96083f7

Please sign in to comment.