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
The below method in SafeKafkaHandle will throw an exception when a non-existent group name is passed:
internal GroupInfo ListGroup(string group, int millisecondsTimeout)
=> ListGroupsImpl(group, millisecondsTimeout).Single();
The exception is due to the implementation of Single() in .NET, where the sequence you invoke it on needs to contain 1 and only 1 item that matches the predicate (in this case no predicate). A different option is SingleOrDefault(), even better is probably FirstOrDefault() as using 'firs't is typically going to perform better as the 'single' methods need to scan the entire collection to make sure there are no duplicates. In this case there should never be more than one so it shouldn't matter.
The text was updated successfully, but these errors were encountered:
The below method in SafeKafkaHandle will throw an exception when a non-existent group name is passed:
The exception is due to the implementation of Single() in .NET, where the sequence you invoke it on needs to contain 1 and only 1 item that matches the predicate (in this case no predicate). A different option is SingleOrDefault(), even better is probably FirstOrDefault() as using 'firs't is typically going to perform better as the 'single' methods need to scan the entire collection to make sure there are no duplicates. In this case there should never be more than one so it shouldn't matter.
The text was updated successfully, but these errors were encountered: