提交 c40cdf09 编写于 作者: H Heng Du 提交者: von gosling

Add RPCHook construct method for MQPullConsumerScheduleService (#1314)

上级 92262928
...@@ -26,9 +26,10 @@ import java.util.concurrent.TimeUnit; ...@@ -26,9 +26,10 @@ import java.util.concurrent.TimeUnit;
import org.apache.rocketmq.client.exception.MQClientException; import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.log.ClientLogger; import org.apache.rocketmq.client.log.ClientLogger;
import org.apache.rocketmq.common.ThreadFactoryImpl; import org.apache.rocketmq.common.ThreadFactoryImpl;
import org.apache.rocketmq.logging.InternalLogger;
import org.apache.rocketmq.common.message.MessageQueue; import org.apache.rocketmq.common.message.MessageQueue;
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
import org.apache.rocketmq.logging.InternalLogger;
import org.apache.rocketmq.remoting.RPCHook;
/** /**
* Schedule service for pull consumer * Schedule service for pull consumer
...@@ -49,6 +50,11 @@ public class MQPullConsumerScheduleService { ...@@ -49,6 +50,11 @@ public class MQPullConsumerScheduleService {
this.defaultMQPullConsumer.setMessageModel(MessageModel.CLUSTERING); this.defaultMQPullConsumer.setMessageModel(MessageModel.CLUSTERING);
} }
public MQPullConsumerScheduleService(final String consumerGroup, final RPCHook rpcHook) {
this.defaultMQPullConsumer = new DefaultMQPullConsumer(consumerGroup, rpcHook);
this.defaultMQPullConsumer.setMessageModel(MessageModel.CLUSTERING);
}
public void putTask(String topic, Set<MessageQueue> mqNewSet) { public void putTask(String topic, Set<MessageQueue> mqNewSet) {
Iterator<Entry<MessageQueue, PullTaskImpl>> it = this.taskTable.entrySet().iterator(); Iterator<Entry<MessageQueue, PullTaskImpl>> it = this.taskTable.entrySet().iterator();
while (it.hasNext()) { while (it.hasNext()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册