in src/Microsoft.Azure.WebJobs.Extensions.Kafka/Listeners/Scaler/KafkaMetricsProvider.cs [96:117]
protected virtual List<TopicPartition> LoadAssignedPartitions()
{
if (this.consumer != null)
{
try
{
var partitions = consumer?.Assignment;
if (partitions == null || partitions.Count == 0)
{
logger.LogError($"Could not load assigned partition information about topic '{this.topicName}'");
return new List<TopicPartition>();
}
return partitions.ToList();
}
catch (Exception ex)
{
logger.LogError(ex, $"Failed to load assigned partition information from topic '{this.topicName}'");
}
}
return new List<TopicPartition>();
}