本文整理匯總了Java中org.apache.rocketmq.client.impl.consumer.ProcessQueue類的典型用法代碼示例。如果您正苦於以下問題:Java ProcessQueue類的具體用法?Java ProcessQueue怎麽用?Java ProcessQueue使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ProcessQueue類屬於org.apache.rocketmq.client.impl.consumer包,在下文中一共展示了ProcessQueue類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createPullRequest
import org.apache.rocketmq.client.impl.consumer.ProcessQueue; //導入依賴的package包/類
private PullRequest createPullRequest() {
PullRequest pullRequest = new PullRequest();
pullRequest.setConsumerGroup(consumerGroup);
pullRequest.setNextOffset(1024);
MessageQueue messageQueue = new MessageQueue();
messageQueue.setBrokerName(brokerName);
messageQueue.setQueueId(0);
messageQueue.setTopic(topic);
pullRequest.setMessageQueue(messageQueue);
ProcessQueue processQueue = new ProcessQueue();
processQueue.setLocked(true);
processQueue.setLastLockTimestamp(System.currentTimeMillis());
pullRequest.setProcessQueue(processQueue);
return pullRequest;
}
開發者ID:lirenzuo,項目名稱:rocketmq-rocketmq-all-4.1.0-incubating,代碼行數:18,代碼來源:DefaultMQPushConsumerTest.java
示例2: ack
import org.apache.rocketmq.client.impl.consumer.ProcessQueue; //導入依賴的package包/類
void ack(final MessageQueue messageQueue, final ProcessQueue processQueue, final MessageExt messageExt) {
consumedRequest.remove(messageExt.getMsgId());
long offset = processQueue.removeMessage(Collections.singletonList(messageExt));
try {
rocketmqPullConsumer.updateConsumeOffset(messageQueue, offset);
} catch (MQClientException e) {
log.error("A error occurred in update consume offset process.", e);
}
}
示例3: getLockInProcessQueue
import org.apache.rocketmq.client.impl.consumer.ProcessQueue; //導入依賴的package包/類
private ReadWriteLock getLockInProcessQueue(ProcessQueue pq) {
try {
return (ReadWriteLock) FieldUtils.readDeclaredField(pq, "lockTreeMap", true);
} catch (IllegalAccessException e) {
return null;
}
}
示例4: registerPullTaskCallback
import org.apache.rocketmq.client.impl.consumer.ProcessQueue; //導入依賴的package包/類
private void registerPullTaskCallback() {
this.pullConsumerScheduleService.registerPullTaskCallback(targetQueueName, new PullTaskCallback() {
@Override
public void doPullTask(final MessageQueue mq, final PullTaskContext context) {
MQPullConsumer consumer = context.getPullConsumer();
try {
long offset = localMessageCache.nextPullOffset(mq);
PullResult pullResult = consumer.pull(mq, "*",
offset, localMessageCache.nextPullBatchNums());
ProcessQueue pq = rocketmqPullConsumer.getDefaultMQPullConsumerImpl().getRebalanceImpl()
.getProcessQueueTable().get(mq);
switch (pullResult.getPullStatus()) {
case FOUND:
if (pq != null) {
pq.putMessage(pullResult.getMsgFoundList());
for (final MessageExt messageExt : pullResult.getMsgFoundList()) {
localMessageCache.submitConsumeRequest(new ConsumeRequest(messageExt, mq, pq));
}
}
break;
default:
break;
}
localMessageCache.updatePullOffset(mq, pullResult.getNextBeginOffset());
} catch (Exception e) {
log.error("A error occurred in pull message process.", e);
}
}
});
}
示例5: ConsumeRequest
import org.apache.rocketmq.client.impl.consumer.ProcessQueue; //導入依賴的package包/類
public ConsumeRequest(final MessageExt messageExt, final MessageQueue messageQueue,
final ProcessQueue processQueue) {
this.messageExt = messageExt;
this.messageQueue = messageQueue;
this.processQueue = processQueue;
}
示例6: getProcessQueue
import org.apache.rocketmq.client.impl.consumer.ProcessQueue; //導入依賴的package包/類
public ProcessQueue getProcessQueue() {
return processQueue;
}