publicvoidrun(){
log.info(this.getServiceName()+" service started");while(!this.isStopped()){try{
PullRequest pullRequest =this.pullRequestQueue.take();this.pullMessage(pullRequest);}catch(InterruptedException ignored){}catch(Exception e){
log.error("Pull Message Service Run Method exception", e);}}
log.info(this.getServiceName()+" service end");}
privatevoidpullMessage(final PullRequest pullRequest){final MQConsumerInner consumer =this.mQClientFactory.selectConsumer(pullRequest.getConsumerGroup());if(consumer != null){
DefaultMQPushConsumerImpl impl =(DefaultMQPushConsumerImpl) consumer;
impl.pullMessage(pullRequest);}else{
log.warn("No matched consumer for the PullRequest {}, drop it", pullRequest);}}