Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.common.message.MessageQueue;
import org.apache.rocketmq.common.sysflag.PullSysFlag;
import org.apache.rocketmq.logging.org.slf4j.Logger;
import org.apache.rocketmq.logging.org.slf4j.LoggerFactory;
import org.apache.rocketmq.remoting.RPCHook;
import org.apache.rocketmq.remoting.exception.RemotingException;
import org.apache.rocketmq.remoting.protocol.NamespaceUtil;
Expand All @@ -73,8 +75,6 @@
import org.apache.rocketmq.remoting.protocol.heartbeat.ConsumeType;
import org.apache.rocketmq.remoting.protocol.heartbeat.MessageModel;
import org.apache.rocketmq.remoting.protocol.heartbeat.SubscriptionData;
import org.apache.rocketmq.logging.org.slf4j.Logger;
import org.apache.rocketmq.logging.org.slf4j.LoggerFactory;

public class DefaultLitePullConsumerImpl implements MQConsumerInner {

Expand Down Expand Up @@ -329,8 +329,8 @@ public synchronized void start() throws MQClientException {

private void initScheduledThreadPoolExecutor() {
this.scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(
this.defaultLitePullConsumer.getPullThreadNums(),
new ThreadFactoryImpl("PullMsgThread-" + this.defaultLitePullConsumer.getConsumerGroup())
this.defaultLitePullConsumer.getPullThreadNums(),
new ThreadFactoryImpl("PullMsgThread-" + this.defaultLitePullConsumer.getConsumerGroup())
);
}

Expand Down Expand Up @@ -912,8 +912,8 @@ public void run() {
scheduledThreadPoolExecutor.schedule(this, PULL_TIME_DELAY_MILLS_WHEN_CACHE_FLOW_CONTROL, TimeUnit.MILLISECONDS);
if ((consumeRequestFlowControlTimes++ % 1000) == 0) {
log.warn("The consume request count exceeds threshold {}, so do flow control, consume request count={}, flowControlTimes={}",
(int)Math.ceil((double)defaultLitePullConsumer.getPullThresholdForAll() / defaultLitePullConsumer.getPullBatchSize()),
consumeRequestCache.size(), consumeRequestFlowControlTimes);
(int) Math.ceil((double) defaultLitePullConsumer.getPullThresholdForAll() / defaultLitePullConsumer.getPullBatchSize()),
consumeRequestCache.size(), consumeRequestFlowControlTimes);
}
return;
}
Expand Down Expand Up @@ -1122,7 +1122,15 @@ public Set<SubscriptionData> subscriptions() {
Set<SubscriptionData> subSet = new HashSet<>();

subSet.addAll(this.rebalanceImpl.getSubscriptionInner().values());

if (!topicToSubExpression.isEmpty()) {
for (Map.Entry<String, String> entry : topicToSubExpression.entrySet()) {
try {
subSet.add(FilterAPI.buildSubscriptionData(entry.getKey(), entry.getValue()));
} catch (Exception e) {
log.warn("BuildSubscriptionData error, topic=[{}], subString=[{}] ", entry.getKey(), entry.getValue(), e);
}
}
}
return subSet;
}

Expand Down
Loading