cloudevents / sdk-csharp

CSharp SDK for CloudEvents
Apache License 2.0
282 stars 82 forks source link

Kafka Cloud events implementation does not provide support For Null, Ignore Key types #313

Open Abuntxa opened 1 month ago

Abuntxa commented 1 month ago

The current extensión methods that allow transforming to and from CloudEvents into Kafka messages expects always messages of type Message<string?, byte[]> where the first generic template parameter is the type of Key in the Kafka messages.

When using the KafkaConsumer or producer it is usual to use the types "Confluent.Kafka.Ignore" or "Confluent.Kafka.Null" too that would handle messages like the following: Message<Confluent.Kafka.Ignore, byte[]> Message<Confluent.Kafka.Null, byte[]>

jskeet commented 1 month ago

This is something I would be unable to take on myself, not being familiar with Kafka. (I basically inherited the current code to maintain.) I'd welcome a pull request that addresses the concern, preferably without any breaking changes to the existing API.

Abuntxa commented 1 month ago

I have provided the following PR as an implementation with no breaking changes.