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


##########
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:
   Thanks for the comments. I have a few questions.
   
   > 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.
   I don't understand what you mean. I'm not changing the current logic. I'm 
just passing through the message id to the partitionConsumer responsible for 
the partition.
   
   > The Go SDK currently does not support seek operations on partitioned 
topics, and this logic is still being implemented.
   All right. Do you know what work still remains to have the Go client support 
seeking by partition?



##########
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:
   Thanks for the comments. I have a few questions.
   
   > 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.
   
   I don't understand what you mean. I'm not changing the current logic. I'm 
just passing through the message id to the partitionConsumer responsible for 
the partition.
   
   > The Go SDK currently does not support seek operations on partitioned 
topics, and this logic is still being implemented.
   
   All right. Do you know what work still remains to have the Go client support 
seeking by partition?



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