public interface MQPullConsumer extends MQConsumer
Modifier and Type | Method and Description |
---|---|
long |
fetchConsumeOffset(MessageQueue mq,
boolean fromStore)
Fetch the offset
|
java.util.Set<MessageQueue> |
fetchMessageQueuesInBalance(java.lang.String topic)
Fetch the message queues according to the topic
|
PullResult |
pull(MessageQueue mq,
java.lang.String subExpression,
long offset,
int maxNums)
Pulling the messages,not blocking
|
PullResult |
pull(MessageQueue mq,
java.lang.String subExpression,
long offset,
int maxNums,
long timeout)
Pulling the messages in the specified timeout
|
void |
pull(MessageQueue mq,
java.lang.String subExpression,
long offset,
int maxNums,
PullCallback pullCallback)
Pulling the messages in a async. way
|
void |
pull(MessageQueue mq,
java.lang.String subExpression,
long offset,
int maxNums,
PullCallback pullCallback,
long timeout)
Pulling the messages in a async. way
|
PullResult |
pullBlockIfNotFound(MessageQueue mq,
java.lang.String subExpression,
long offset,
int maxNums)
Pulling the messages,if no message arrival,blocking some time
|
void |
pullBlockIfNotFound(MessageQueue mq,
java.lang.String subExpression,
long offset,
int maxNums,
PullCallback pullCallback)
Pulling the messages through callback function,if no message arrival,blocking.
|
void |
registerMessageQueueListener(java.lang.String topic,
MessageQueueListener listener)
Register the message queue listener
|
void |
sendMessageBack(MessageExt msg,
int delayLevel,
java.lang.String brokerName,
java.lang.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, sendMessageBack
createTopic, createTopic, earliestMsgStoreTime, maxOffset, minOffset, queryMessage, searchOffset, viewMessage, viewMessage
void start() throws MQClientException
MQClientException
void shutdown()
void registerMessageQueueListener(java.lang.String topic, MessageQueueListener listener)
topic
- listener
- PullResult pull(MessageQueue mq, java.lang.String subExpression, long offset, int maxNums) throws MQClientException, RemotingException, MQBrokerException, java.lang.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 numbersPullRequest
MQClientException
java.lang.InterruptedException
MQBrokerException
RemotingException
PullResult pull(MessageQueue mq, java.lang.String subExpression, long offset, int maxNums, long timeout) throws MQClientException, RemotingException, MQBrokerException, java.lang.InterruptedException
mq
- subExpression
- offset
- maxNums
- timeout
- PullRequest
MQClientException
RemotingException
MQBrokerException
java.lang.InterruptedException
void pull(MessageQueue mq, java.lang.String subExpression, long offset, int maxNums, PullCallback pullCallback) throws MQClientException, RemotingException, java.lang.InterruptedException
mq
- subExpression
- offset
- maxNums
- pullCallback
- MQClientException
RemotingException
java.lang.InterruptedException
void pull(MessageQueue mq, java.lang.String subExpression, long offset, int maxNums, PullCallback pullCallback, long timeout) throws MQClientException, RemotingException, java.lang.InterruptedException
mq
- subExpression
- offset
- maxNums
- pullCallback
- timeout
- MQClientException
RemotingException
java.lang.InterruptedException
PullResult pullBlockIfNotFound(MessageQueue mq, java.lang.String subExpression, long offset, int maxNums) throws MQClientException, RemotingException, MQBrokerException, java.lang.InterruptedException
mq
- subExpression
- offset
- maxNums
- PullRequest
MQClientException
RemotingException
MQBrokerException
java.lang.InterruptedException
void pullBlockIfNotFound(MessageQueue mq, java.lang.String subExpression, long offset, int maxNums, PullCallback pullCallback) throws MQClientException, RemotingException, java.lang.InterruptedException
mq
- subExpression
- offset
- maxNums
- pullCallback
- MQClientException
RemotingException
java.lang.InterruptedException
void updateConsumeOffset(MessageQueue mq, long offset) throws MQClientException
mq
- offset
- MQClientException
long fetchConsumeOffset(MessageQueue mq, boolean fromStore) throws MQClientException
mq
- fromStore
- MQClientException
java.util.Set<MessageQueue> fetchMessageQueuesInBalance(java.lang.String topic) throws MQClientException
topic
- message topicMQClientException
void sendMessageBack(MessageExt msg, int delayLevel, java.lang.String brokerName, java.lang.String consumerGroup) throws RemotingException, MQBrokerException, java.lang.InterruptedException, MQClientException
msg
- delayLevel
- brokerName
- consumerGroup
- RemotingException
MQBrokerException
java.lang.InterruptedException
MQClientException