sdk-go icon indicating copy to clipboard operation
sdk-go copied to clipboard

[kafka_confluent] should propagate partitionkey on an event level

Open bread-amammay opened this issue 6 months ago • 1 comments

Issue

Currently you have to interact with https://github.com/cloudevents/sdk-go/blob/7fef294789916760157377cb07dc5bd55d31e562/protocol/kafka_confluent/v2/option.go#L137-L151 to set the partition key on an outgoing event. If you have multiple events are you sending on a single context you have to keep swapping values.

Proposal

I propose that the paradigm from kafka_sarama is copied over where it checks to see if the partition key is set on an a cloud event extension, if it is, set that on the outgoing record. https://github.com/cloudevents/sdk-go/blob/f1c0d0aac5ac90027b6e5504a44a14fa8f1985d9/protocol/kafka_sarama/v2/write_producer_message.go#L38-L48

  • tagging @yanmxa for thoughts since i seen you wrote the implementation of https://github.com/cloudevents/sdk-go/pull/988

bread-amammay avatar Aug 14 '24 18:08 bread-amammay