confluentinc / confluent-kafka-dotnet

Confluent's Apache Kafka .NET client
https://github.com/confluentinc/confluent-kafka-dotnet/wiki
Apache License 2.0
61 stars 861 forks source link

Introduce simplified producer syntax #2148

Open sungam3r opened 10 months ago

sungam3r commented 10 months ago

This PR adds implicit cast operators from value tuples to Message<T,V> to allow such syntax

p.Produce("my-topic", i.ToString(), handler);

compared to current syntax

p.Produce("my-topic", new Message<Null, string> { Value = i.ToString() }, handler);

The goal is to reduce boilerplate code from user code shifting all needed machinery to compiler.

This PR adds one additional dependency for netstandard1.3 target:

<PackageReference Include="System.ValueTuple" Version="4.5.0" />