dao-jun commented on code in PR #22639:
URL: https://github.com/apache/pulsar/pull/22639#discussion_r1588532988


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ReaderBuilderImpl.java:
##########
@@ -86,7 +86,8 @@ public CompletableFuture<Reader<T>> createAsync() {
                     .failedFuture(new IllegalArgumentException("Topic name 
must be set on the reader builder"));
         }
 
-        if (conf.getStartMessageId() != null && 
conf.getStartMessageFromRollbackDurationInSec() > 0
+        boolean isStartMsgIdExist = conf.getStartMessageId() != null && 
conf.getStartMessageId() != MessageId.earliest;
+        if (isStartMsgIdExist && 
conf.getStartMessageFromRollbackDurationInSec() > 0

Review Comment:
   ```java
           if ((isStartMsgIdExist && 
conf.getStartMessageFromRollbackDurationInSec() > 0)
                   || (conf.getStartMessageId() == null && 
conf.getStartMessageFromRollbackDurationInSec() <= 0)) {
               return FutureUtil
                       .failedFuture(new IllegalArgumentException(
                               "Start message id or start message from roll 
back must be specified but they cannot be"
                                       + " specified at the same time"));
           }
   ```



-- 
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]

Reply via email to