Skip to content

Commit

Permalink
[fix][broker] Revert "[improve][client] Add log when can't add messag…
Browse files Browse the repository at this point in the history
…e to the container (apache#23657)
  • Loading branch information
Technoboy- authored Nov 29, 2024
1 parent 3a50255 commit d1753ee
Showing 1 changed file with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import net.jcip.annotations.NotThreadSafe;
import org.apache.pulsar.client.api.Message;
import org.apache.pulsar.client.api.Messages;

@NotThreadSafe
@Slf4j
public class MessagesImpl<T> implements Messages<T> {

private final List<Message<T>> messageList;
Expand All @@ -51,14 +49,10 @@ protected boolean canAdd(Message<T> message) {
return true;
}
if (maxNumberOfMessages > 0 && currentNumberOfMessages + 1 > maxNumberOfMessages) {
log.warn("can't add message to the container, has exceeded the maxNumberOfMessages : {} ",
maxNumberOfMessages);
return false;
}

if (maxSizeOfMessages > 0 && currentSizeOfMessages + message.size() > maxSizeOfMessages) {
log.warn("can't add message to the container, has exceeded the maxSizeOfMessages : {} ",
maxSizeOfMessages);
return false;
}

Expand Down

0 comments on commit d1753ee

Please sign in to comment.