async_producer: clarify ProducerMessage `Timestamp` doc
@@ -191,10 +191,17 @@ type ProducerMessage struct {
// Partition is the partition that the message was sent to. This is only
// guaranteed to be defined if the message was successfully delivered.
Partition int32
- // Timestamp is the timestamp assigned to the message by the broker. This
+ // Timestamp can vary in behaviour depending on broker configuration, being
- // is only guaranteed to be defined if the message was successfully
+ // in either one of the CreateTime or LogAppendTime modes (default CreateTime),
- // delivered, RequiredAcks is not NoResponse, and the Kafka broker is at
+ // and requiring version at least 0.10.0.
- // least version 0.10.0.
+ //
+ // When configured to CreateTime, the timestamp is specified by the producer
+ // either by explicitly setting this field, or when the message is added
+ // to a produce set.
+ // When configured to LogAppendTime, the timestamp assigned to the message
+ // by the broker. This is only guaranteed to be defined if the message was
+ // successfully delivered and RequiredAcks is not NoResponse.
Timestamp time.Time
retries int