mirror of
https://github.com/apache/rocketmq.git
synced 2026-08-30 18:10:44 +08:00
@@ -199,8 +199,14 @@ public class PopConsumerService extends ServiceThread {
|
||||
return context;
|
||||
}
|
||||
|
||||
public long getPopOffset(String groupId, String topicId, int queueId, int initMode) {
|
||||
long offset = this.brokerController.getConsumerOffsetManager().queryPullOffset(groupId, topicId, queueId);
|
||||
public long getPopOffset(String groupId, String topicId, int queueId, int initMode, boolean fifo) {
|
||||
|
||||
// For FIFO messages, the pull offset is not used.
|
||||
// This preserves compatibility when switching from pull consumer to pop consumer.
|
||||
long offset = fifo ?
|
||||
this.brokerController.getConsumerOffsetManager().queryOffset(groupId, topicId, queueId) :
|
||||
this.brokerController.getConsumerOffsetManager().queryPullOffset(groupId, topicId, queueId);
|
||||
|
||||
if (offset < 0L) {
|
||||
try {
|
||||
offset = this.brokerController.getPopMessageProcessor()
|
||||
@@ -309,7 +315,7 @@ public class PopConsumerService extends ServiceThread {
|
||||
result.addRestCount(this.getPendingFilterCount(groupId, topicId, queueId));
|
||||
return CompletableFuture.completedFuture(result);
|
||||
} else {
|
||||
final long consumeOffset = this.getPopOffset(groupId, topicId, queueId, result.getInitMode());
|
||||
final long consumeOffset = this.getPopOffset(groupId, topicId, queueId, result.getInitMode(), result.isFifo());
|
||||
return getMessageAsync(clientHost, groupId, topicId, queueId, consumeOffset, remain, filter)
|
||||
.thenApply(getMessageResult -> handleGetMessageResult(
|
||||
result, getMessageResult, topicId, queueId, retryType, consumeOffset));
|
||||
|
||||
Reference in New Issue
Block a user