wuYin commented on a change in pull request #394:
URL: https://github.com/apache/pulsar-client-go/pull/394#discussion_r527372119



##########
File path: pulsar/producer.go
##########
@@ -76,6 +76,15 @@ type ProducerOptions struct {
        // This properties will be visible in the topic stats
        Properties map[string]string
 
+       // SendTimeout set the timeout for a message that not be acknowledged 
by server since sent.
+       // Send and SendAsync returns an error after timeout.
+       // Default is 30 seconds, -1 to disable.
+       SendTimeout time.Duration

Review comment:
       Thanks for review.
   
   I see [PR#252](https://github.com/apache/pulsar-client-go/pull/252) 
implementing `sendTimeout` with context but progress has stalled.
   
   Personally think there are 2 ways to implement `sendTimeout`
   
   1. **message level**
       - Perpose: precisely control the expiration time of every message, so 
that different messages can have different expiration, like 
`consumer.Receive()` did.
       - Implementation: set timeout context in Send, and check for every 
message.
   
   2. **producer level**
       - Perpose: send timeout for producer instance is sufficient for most 
situation, like client-java did.
       - Implementation: set timeout timer to periodic fail pending queue.
       - Trade-off: optional big change, we may need remove context parameter 
from Send method.
   
   I will try If context way is better, looking forward to reply, thanks.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to