Skip to content

Commit

Permalink
Delete unused codes in ConsumerImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
nkurihar committed Oct 1, 2024
1 parent 02e47a9 commit c3d42df
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions lib/ConsumerImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,7 @@ void ConsumerImpl::sendFlowPermitsToBroker(const ClientConnectionPtr& cnx, int n
Result ConsumerImpl::handleCreateConsumer(const ClientConnectionPtr& cnx, Result result) {
Result handleResult = ResultOk;

static bool firstTime = true;
if (result == ResultOk) {
if (firstTime) {
firstTime = false;
}
LOG_INFO(getName() << "Created consumer on broker " << cnx->cnxString());
{
Lock lock(mutex_);
Expand All @@ -313,12 +309,10 @@ Result ConsumerImpl::handleCreateConsumer(const ClientConnectionPtr& cnx, Result
}

LOG_DEBUG(getName() << "Send initial flow permits: " << config_.getReceiverQueueSize());
if (consumerTopicType_ == NonPartitioned || !firstTime) {
if (config_.getReceiverQueueSize() != 0) {
sendFlowPermitsToBroker(cnx, config_.getReceiverQueueSize());
} else if (messageListener_) {
sendFlowPermitsToBroker(cnx, 1);
}
if (config_.getReceiverQueueSize() != 0) {
sendFlowPermitsToBroker(cnx, config_.getReceiverQueueSize());
} else if (messageListener_) {
sendFlowPermitsToBroker(cnx, 1);
}
consumerCreatedPromise_.setValue(get_shared_this_ptr());
} else {
Expand Down

0 comments on commit c3d42df

Please sign in to comment.