shibd commented on code in PR #17318:
URL: https://github.com/apache/pulsar/pull/17318#discussion_r990634402
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java:
##########
@@ -839,7 +839,7 @@ protected boolean canEnqueueMessage(Message<T> message) {
protected boolean enqueueMessageAndCheckBatchReceive(Message<T> message) {
int messageSize = message.size();
- if (canEnqueueMessage(message) && incomingMessages.offer(message)) {
+ if (isValidConsumerEpoch(message) && canEnqueueMessage(message) &&
incomingMessages.offer(message)) {
Review Comment:
> If the consumer has pending receive requests. The message will be used to
complete the pending receive requests directly.
For users, when having pending receive, It does not call the
`redeliverUnacknowledgedMessages` method. It is only recommended to use the
following methods.
``` java
consumer.receive(timeOut);
// do something.
consumer.redeliverUnacknowledgedMessages();
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]