Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/consumer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ Baton Consumer::Assign(std::vector<RdKafka::TopicPartition*> partitions) {
m_partition_cnt = partitions.size();
m_partitions.swap(partitions);

m_is_subscribed = true;

return Baton(RdKafka::ERR_NO_ERROR);
}

Expand All @@ -172,8 +170,6 @@ Baton Consumer::Unassign() {
return Baton(errcode);
}

m_is_subscribed = false;

m_partitions.empty();
m_partition_cnt = 0;

Expand Down Expand Up @@ -250,9 +246,9 @@ Baton Consumer::Subscribe(std::vector<std::string> topics) {
NodeKafka::Message* Consumer::Consume() {
NodeKafka::Message* m;

if (IsConnected() && IsSubscribed()) {
if (IsConnected()) {
scoped_mutex_lock lock(m_connection_lock);
if (!IsConnected() && IsSubscribed()) {
if (!IsConnected()) {
m = new NodeKafka::Message(RdKafka::ERR__STATE);
} else {
RdKafka::KafkaConsumer* consumer =
Expand Down
2 changes: 1 addition & 1 deletion src/workers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ ConsumerConsumeLoop::~ConsumerConsumeLoop() {}

void ConsumerConsumeLoop::Execute(const ExecutionMessageBus& bus) {
// Do one check here before we move forward
while (consumer->IsConnected() && consumer->IsSubscribed()) {
while (consumer->IsConnected()) {
NodeKafka::Message* message = consumer->Consume();
if (message->errcode() == RdKafka::ERR__PARTITION_EOF) {
delete message;
Expand Down