com.alibaba.rocketmq.client.impl.consumer
类 PullAPIWrapper

java.lang.Object
  继承者 com.alibaba.rocketmq.client.impl.consumer.PullAPIWrapper

public class PullAPIWrapper
extends Object

对Pull接口进行进一步的封装

从以下版本开始:
2013-7-24
作者:
shijia.wxr

构造方法摘要
PullAPIWrapper(MQClientFactory mQClientFactory, String consumerGroup)
           
 
方法摘要
 PullResult processPullResult(MessageQueue mq, PullResult pullResult, SubscriptionData subscriptionData)
          对拉取结果进行处理,主要是消息反序列化
 PullResult pullKernelImpl(MessageQueue mq, String subExpression, long subVersion, long offset, int maxNums, int sysFlag, long commitOffset, long brokerSuspendMaxTimeMillis, long timeoutMillis, CommunicationMode communicationMode, PullCallback pullCallback)
           
 long recalculatePullFromWhichNode(MessageQueue mq)
          每个队列都应该有相应的变量来保存从哪个服务器拉
 void updatePullFromWhichNode(MessageQueue mq, long brokerId)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

PullAPIWrapper

public PullAPIWrapper(MQClientFactory mQClientFactory,
                      String consumerGroup)
方法详细信息

updatePullFromWhichNode

public void updatePullFromWhichNode(MessageQueue mq,
                                    long brokerId)

processPullResult

public PullResult processPullResult(MessageQueue mq,
                                    PullResult pullResult,
                                    SubscriptionData subscriptionData)
对拉取结果进行处理,主要是消息反序列化

参数:
mq -
pullResult -
subscriptionData -
projectGroupPrefix - 虚拟环境projectGroupPrefix,不存在可设置为 null
返回:

recalculatePullFromWhichNode

public long recalculatePullFromWhichNode(MessageQueue mq)
每个队列都应该有相应的变量来保存从哪个服务器拉


pullKernelImpl

public PullResult pullKernelImpl(MessageQueue mq,
                                 String subExpression,
                                 long subVersion,
                                 long offset,
                                 int maxNums,
                                 int sysFlag,
                                 long commitOffset,
                                 long brokerSuspendMaxTimeMillis,
                                 long timeoutMillis,
                                 CommunicationMode communicationMode,
                                 PullCallback pullCallback)
                          throws MQClientException,
                                 RemotingException,
                                 MQBrokerException,
                                 InterruptedException
抛出:
MQClientException
RemotingException
MQBrokerException
InterruptedException


Copyright © 2012-2014. All Rights Reserved.