public interface MQPullConsumer extends MQConsumer
| 限定符和类型 | 方法和说明 |
|---|---|
long |
fetchConsumeOffset(MessageQueue mq,
boolean fromStore)
Fetch the offset
|
Set<MessageQueue> |
fetchMessageQueuesInBalance(String topic)
Fetch the message queues according to the topic
|
PullResult |
pull(MessageQueue mq,
String subExpression,
long offset,
int maxNums)
Pulling the messages,not blocking
|
PullResult |
pull(MessageQueue mq,
String subExpression,
long offset,
int maxNums,
long timeout)
Pulling the messages in the specified timeout
|
void |
pull(MessageQueue mq,
String subExpression,
long offset,
int maxNums,
PullCallback pullCallback)
Pulling the messages in a async. way
|
void |
pull(MessageQueue mq,
String subExpression,
long offset,
int maxNums,
PullCallback pullCallback,
long timeout)
Pulling the messages in a async. way
|
PullResult |
pullBlockIfNotFound(MessageQueue mq,
String subExpression,
long offset,
int maxNums)
Pulling the messages,if no message arrival,blocking some time
|
void |
pullBlockIfNotFound(MessageQueue mq,
String subExpression,
long offset,
int maxNums,
PullCallback pullCallback)
Pulling the messages through callback function,if no message arrival,blocking.
|
void |
registerMessageQueueListener(String topic,
MessageQueueListener listener)
Register the message queue listener
|
void |
sendMessageBack(MessageExt msg,
int delayLevel,
String brokerName,
String consumerGroup)
If consuming failure,message will be send back to the broker,and delay consuming in some time later.
|
void |
shutdown()
Shutdown the consumer
|
void |
start()
Start the consumer
|
void |
updateConsumeOffset(MessageQueue mq,
long offset)
Update the offset
|
fetchSubscribeMessageQueues, sendMessageBack, sendMessageBackcreateTopic, createTopic, earliestMsgStoreTime, maxOffset, minOffset, queryMessage, searchOffset, viewMessage, viewMessagevoid start()
throws MQClientException
void shutdown()
void registerMessageQueueListener(String topic, MessageQueueListener listener)
topic - listener - PullResult pull(MessageQueue mq, String subExpression, long offset, int maxNums) throws MQClientException, com.alibaba.rocketmq.remoting.exception.RemotingException, MQBrokerException, InterruptedException
mq - from which message queuesubExpression - subscription expression.it only support or operation such as "tag1 || tag2 || tag3" offset - from where to pullmaxNums - max pulling numbersMQClientExceptionInterruptedExceptionMQBrokerExceptioncom.alibaba.rocketmq.remoting.exception.RemotingExceptionPullResult pull(MessageQueue mq, String subExpression, long offset, int maxNums, long timeout) throws MQClientException, com.alibaba.rocketmq.remoting.exception.RemotingException, MQBrokerException, InterruptedException
mq - subExpression - offset - maxNums - timeout - MQClientExceptioncom.alibaba.rocketmq.remoting.exception.RemotingExceptionMQBrokerExceptionInterruptedExceptionvoid pull(MessageQueue mq, String subExpression, long offset, int maxNums, PullCallback pullCallback) throws MQClientException, com.alibaba.rocketmq.remoting.exception.RemotingException, InterruptedException
mq - subExpression - offset - maxNums - pullCallback - MQClientExceptioncom.alibaba.rocketmq.remoting.exception.RemotingExceptionInterruptedExceptionvoid pull(MessageQueue mq, String subExpression, long offset, int maxNums, PullCallback pullCallback, long timeout) throws MQClientException, com.alibaba.rocketmq.remoting.exception.RemotingException, InterruptedException
mq - subExpression - offset - maxNums - pullCallback - timeout - MQClientExceptioncom.alibaba.rocketmq.remoting.exception.RemotingExceptionInterruptedExceptionPullResult pullBlockIfNotFound(MessageQueue mq, String subExpression, long offset, int maxNums) throws MQClientException, com.alibaba.rocketmq.remoting.exception.RemotingException, MQBrokerException, InterruptedException
mq - subExpression - offset - maxNums - MQClientExceptioncom.alibaba.rocketmq.remoting.exception.RemotingExceptionMQBrokerExceptionInterruptedExceptionvoid pullBlockIfNotFound(MessageQueue mq, String subExpression, long offset, int maxNums, PullCallback pullCallback) throws MQClientException, com.alibaba.rocketmq.remoting.exception.RemotingException, InterruptedException
mq - subExpression - offset - maxNums - pullCallback - MQClientExceptioncom.alibaba.rocketmq.remoting.exception.RemotingExceptionInterruptedExceptionvoid updateConsumeOffset(MessageQueue mq, long offset) throws MQClientException
mq - offset - MQClientExceptionlong fetchConsumeOffset(MessageQueue mq, boolean fromStore) throws MQClientException
mq - fromStore - MQClientExceptionSet<MessageQueue> fetchMessageQueuesInBalance(String topic) throws MQClientException
topic - message topicMQClientExceptionvoid sendMessageBack(MessageExt msg, int delayLevel, String brokerName, String consumerGroup) throws com.alibaba.rocketmq.remoting.exception.RemotingException, MQBrokerException, InterruptedException, MQClientException
msg - delayLevel - brokerName - consumerGroup - com.alibaba.rocketmq.remoting.exception.RemotingExceptionMQBrokerExceptionInterruptedExceptionMQClientExceptionCopyright © 2012–2016. All rights reserved.