Open ChadJessup opened 4 years ago
We're not intentionally providing a dumbed down/simplified API - where a feature isn't exposed it's because we just haven't added it to the binding yet, or it's not implemented in librdkafka yet. the API was designed to be extensible enough for any capability we could foresee.
feel free to provide specific examples of gaps, and we can provide specific guidance on how we envisage that fitting into the API.
we'd be very happy to see a streams layer on top of this library. I've had a go myself (but my motivation really was on playing with some novel ideas, not duplicate kafka streams - i don't have the bandwidth to do a production ready stream processing library).
I'm sorry, I didn't mean to imply that there were problems with the Api as it stands today. I'm sure my ignorance on many aspects is a big factor here.
I'll summarize some of the general issues I've come across below, and open up new issues/PRs on specific problems I can't seem to address on my own.
With much of the implementation marked internal, being required to use the Builder pattern, and not having access to the interop layer, I'm not able to easily (or at all) use a few C# patterns that I'm used to (I might be the only one having these issues, of course):
.SetLogHandler(ILogHandler)
and .SetErrorHandler(IErrorHandler)
also existed, I could derive from these interfaces in a single class and pass that in without another convenience/abstraction layer. As-is, I believe I have to go the route we have here (using a modified confluent-kafka-dotnet library due to #1123):
https://github.com/ChadJessup/Kafka.Streams.net/blob/3814060c26901a0cd01f15c33102ffedb8e1c7a8/Kafka.Streams.net/Kafka.Streams/Clients/DefaultKafkaClientSupplier.cs#L65-L67As for my Kafka Streams port, it's very early, and mainly a copy/paste of the Java code for now. But it feels like a Kafka Streams library for C# would fit in quite well, since C# devs are already used to that look and feel of programming due to Linq. I enjoyed your blog posts on exploring streams, thanks for writing those up.
In parallel to the Kafka Streams port, I believe a couple extra libraries can be hit on the way, an AspNetCore library hooking up DI, ILogger, IConfiguration, (Kafka as a ConfigurationProvider, as well as using other ConfigurationProviders to configure this Kafka library), and a Linq Provider. But, we'll see.
Thanks for listening and your help, and I'm looking forward to the future of this library.
I'm currently trying to port Kafka Streams to C# and I'm hitting some issues with the current API approach of this C# kafka library. I believe that the current design is to help reduce support/maintenance burden, and help users fall into the 'pit of success', and I think it does that well.
But, I'm having quite a bit of difficulty doing more advanced scenarios, and I'm not sure I can provide a framework on top of this library without being able to access some of the internals and/or override some of the behavior that's built-in.
What, if any, plans are there for allowing access to some of the internals, or more raw access to the underlying librdkafka interop layer through this library? I feel that opening* it up a little would allow for a vibrant ecosystem to form over this officially supported library. As it'd be a shame to fork just to change some access modifiers. Unless that's the approach that Confluent would like people to go?
By opening up, I've seen a couple good approaches in other officially supported libraries along these lines. NEST - has a Property called InnerApi for accessing the underlying ElasticSearch raw API. Or a `.Core` library, that can be optionally referenced which contains primitives to be consumed by advanced scenarios.
I'd be more than willing to open up a PR exploring something like the above, but I don't want to waste the maintainer's time if that's a direction that isn't desired.
Thanks