You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// MessageKeyFrom looks in the given context and returns `messageKey` as a string if found and valid, otherwise "".
funcMessageKeyFrom(ctx context.Context) string {
c:=ctx.Value(keyForMessageKey)
ifc!=nil {
ifs, ok:=c.(string); ok {
returns
}
}
return""
}
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.
Thanks @bread-amammay!
I see that both implementations use the same way to inject the partitionKey for the Sender. The difference is that the sarma implementation also adds partitionKey by event extension. But what if the key exists in both context and extension?
I agree with the idea of supporting the partitionKey at the event level. But we need to document their priorities.
Issue
Currently you have to interact with
sdk-go/protocol/kafka_confluent/v2/option.go
Lines 137 to 151 in 7fef294
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.sdk-go/protocol/kafka_sarama/v2/write_producer_message.go
Lines 38 to 48 in f1c0d0a
The text was updated successfully, but these errors were encountered: