kaffe icon indicating copy to clipboard operation
kaffe copied to clipboard

How to set kafka headers when publishing message

Open lud opened this issue 4 years ago • 1 comments

I can't find anything in the docs or the code. I'm trying to pass a map %{value: value, headers: headers} as it seems supported by brod, but I get this error : no function clause matching in anonymous fn/1 in Kaffe.Producer.add_timestamp/1.

Any idea how can this be achieved?

Thank you

lud avatar Oct 15 '21 15:10 lud

I use this workaround currently:

    :brod.produce_sync(
      Kaffe.Config.Producer.configuration().client_name,
      topic,
      &brod_partitionner/4,
      :ignored_key,
      [%{key: key, headers: headers, value: payload}]
    )

lud avatar Oct 15 '21 16:10 lud