severinson commented on code in PR #829:
URL: https://github.com/apache/pulsar-client-go/pull/829#discussion_r948075136


##########
pulsar/consumer_impl.go:
##########
@@ -575,15 +575,21 @@ func (c *consumer) Seek(msgID MessageID) error {
        c.Lock()
        defer c.Unlock()
 
-       if len(c.consumers) > 1 {
-               return newError(SeekFailed, "for partition topic, seek command 
should perform on the individual partitions")
-       }
-
        mid, ok := c.messageID(msgID)
        if !ok {
                return nil
        }
 
+       if mid.partitionIdx < 0 {
+               return newError(SeekFailed, "partitionIdx is negative")
+       }

Review Comment:
   Is that really true? The pre-existing code would do the following:
   ```
   return c.consumers[mid.partitionIdx].Seek(mid)
   ```
   
   This suggests that the partition index is 0 for non-partitioned topics. 
Otherwise seek() on a non-partitioned topic would've always resulted in an 
index out of bounds panic.



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