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
|
方法摘要 |
void |
executeHook(FilterMessageContext context)
|
boolean |
hasHook()
|
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 |
registerFilterMessageHook(ArrayList<FilterMessageHook> filterMessageHookList)
|
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,
boolean isUnitMode)
updatePullFromWhichNode
public void updatePullFromWhichNode(MessageQueue mq,
long brokerId)
processPullResult
public PullResult processPullResult(MessageQueue mq,
PullResult pullResult,
SubscriptionData subscriptionData)
- 对拉取结果进行处理,主要是消息反序列化
- 参数:
mq - pullResult - subscriptionData -
- 返回:
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
hasHook
public boolean hasHook()
registerFilterMessageHook
public void registerFilterMessageHook(ArrayList<FilterMessageHook> filterMessageHookList)
executeHook
public void executeHook(FilterMessageContext context)
Copyright © 2012-2014. All Rights Reserved.