Set the ConsumedOffsetOutOfRange value only if it get changed

This commit is contained in:
YixuanLiu 2016-05-13 10:23:35 -07:00
Родитель 2c6d52080f
Коммит 5452efc41f
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -106,7 +106,11 @@ namespace Kafka.Client.Consumers
switch (messages.ErrorCode)
{
case (short)ErrorMapping.NoError:
partitionTopicInfo.ConsumedOffsetOutOfRange = false;
if (partitionTopicInfo.ConsumedOffsetOutOfRange)
{
partitionTopicInfo.ConsumedOffsetOutOfRange = false;
}
int bytesRead = partitionTopicInfo.Add(messages);
// TODO: The highwater offset on the message set is the end of the log partition. If the message retrieved is -1 of that offset, we are at the end.
if (messages.Messages.Any())