File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -590,6 +590,21 @@ optional<SharedBuffer> ConsumerImpl::processMessageChunk(const SharedBuffer& pay
590590 increaseAvailablePermits (cnx);
591591 }
592592 lock.unlock ();
593+ // The uncached chunk cannot be assembled into a complete message.
594+ // If the message has expired, acknowledge it directly to avoid ack holes;
595+ // otherwise, track it in the unacked message tracker so it will be redelivered on timeout.
596+ if (expireTimeOfIncompleteChunkedMessageMs_ > 0 &&
597+ TimeUtils::currentTimeMillis () >
598+ static_cast <long >(metadata.publish_time ()) + expireTimeOfIncompleteChunkedMessageMs_) {
599+ acknowledgeAsync (messageId, [uuid, messageId](Result result) {
600+ if (result != ResultOk) {
601+ LOG_WARN (" Failed to acknowledge uncached chunk, uuid: " << uuid
602+ << " , messageId: " << messageId);
603+ }
604+ });
605+ } else {
606+ trackMessage (messageId);
607+ }
593608 return {};
594609 }
595610
@@ -656,6 +671,8 @@ optional<SharedBuffer> ConsumerImpl::processMessageChunk(const SharedBuffer& pay
656671 << " , messageId: " << messageId);
657672 }
658673 });
674+ } else {
675+ trackMessage (messageId);
659676 }
660677 return {};
661678 }
You can’t perform that action at this time.
0 commit comments