Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
don't crash if consumer_group is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
emmettbutler committed Apr 24, 2015
1 parent 334b1d9 commit edc5e8b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pykafka/simpleconsumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import base
from .common import OffsetType
from .exceptions import (OffsetOutOfRangeError, UnknownTopicOrPartition,
OffsetMetadataTooLarge, OffsetsLoadInProgress,
NotCoordinatorForConsumer)
OffsetMetadataTooLarge, OffsetsLoadInProgress,
NotCoordinatorForConsumer)

from .utils.error_handlers import handle_partition_responses, raise_error
from .protocol import (PartitionFetchRequest, PartitionOffsetCommitRequest,
Expand Down Expand Up @@ -158,7 +158,8 @@ def _handle_NotCoordinatorForConsumer(parts):
}

def _discover_offset_manager(self):
self._offset_manager = self._cluster.get_offset_manager(self._consumer_group)
if self._consumer_group is not None:
self._offset_manager = self._cluster.get_offset_manager(self._consumer_group)

@property
def topic(self):
Expand Down

0 comments on commit edc5e8b

Please sign in to comment.