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


##########
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:
   In Go SDK, the partition index less than 0 is not allowed.
   
   ```
   // did we receive a valid partition index?
        if partition < 0 || partition >= len(c.consumers) {
                c.log.Warnf("invalid partition index %d expected a partition 
between [0-%d]",
                        partition, len(c.consumers))
                return trackingMessageID{}, false
        }
   ```
   
   And why do we need to modify the current logic, where the number of 
consumers is equivalent to the number of partitions, and each partition 
corresponds to a unique consumer.
   
   The Go SDK currently does not support seek operations on partitioned topics, 
and this logic is still being implemented.



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