You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/08/10 05:13:18 UTC

[GitHub] [pulsar-client-go] merlimat commented on a change in pull request #586: [issue 585] retryRouter should Nack this message if error is not nil

merlimat commented on a change in pull request #586:
URL: https://github.com/apache/pulsar-client-go/pull/586#discussion_r685695372



##########
File path: pulsar/retry_router.go
##########
@@ -87,10 +87,15 @@ func (r *retryRouter) run() {
 			producer := r.getProducer()
 
 			msgID := rm.consumerMsg.ID()
-			producer.SendAsync(context.Background(), &rm.producerMsg, func(MessageID, *ProducerMessage, error) {
-				// TODO: if router produce failed, should Nack this message
-				r.log.WithField("msgID", msgID).Debug("Sent message to RLQ")
-				rm.consumerMsg.Consumer.AckID(msgID)
+			producer.SendAsync(context.Background(), &rm.producerMsg, func(messageID MessageID,
+				producerMessage *ProducerMessage, err error) {
+				if err != nil {
+					r.log.WithField("msgID", msgID).Errorf("Sent message to RLQ,error=%v", err)

Review comment:
       We should preferably use `WithError(err)` in the logger, to retain the structured form




-- 
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: commits-unsubscribe@pulsar.apache.org

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