Consumer constructor is marked internal
See original GitHub issueDescription
Confluent.Kafka 1.0 RC4
Consumer has one constructor that is marked as internal, making it impossible to extend. Is this intended? This forces a developer to wrap the class to associate data with the consumer (changing all the code from consumer.Consume() to consumerWrapper.Consumer.Consume(), for example).
One option is to make the constructor public.
Another option is to seal the class or mark it as internal, only allowing the interface to be used externally, making it clear that the class cannot be inherited.
How to reproduce
The following will not build because the constructor is marked internal.
public class ExtendedConsumer<TKey,TValue> : Consumer<TKey,TValue>
{
public ExtendedConsumer(ConsumerBuilder<TKey,TValue> builder):base(builder){};
}
Possibly related issues:
https://github.com/confluentinc/confluent-kafka-dotnet/issues/151 https://github.com/confluentinc/confluent-kafka-dotnet/issues/777
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Consumer Constructor Pitfalls - java
Consumer constructors appear to present a concise way in Java to write code that in other languages would be referred to as "properties"....
Read more >Dependency injection for a library with internal dependencies
My services have constructor arguments that allow the repositories to be injected into them. But the repositories are internal so the web site ......
Read more >Using Constructors - C# Programming Guide
Constructors can be marked as public, private, protected, internal, protected internal or private protected. These access modifiers define ...
Read more >Required members - C# 11.0 draft feature specifications
All constructors in a type with required members, or whose base type specifies required members, must have those members set by a consumer...
Read more >Interfaces are access modifiers by Mark Seemann - ploeh blog
NET developers should be familiar with the standard access modifiers (public, protected, internal, private). However, in loosely coupled ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
#888 actions this issue
Understood. Thanks for the explanation!