GPrabhudas commented on a change in pull request #612:
URL: https://github.com/apache/pulsar-client-go/pull/612#discussion_r709138229
##########
File path: pulsar/consumer_partition.go
##########
@@ -479,7 +505,49 @@ func (pc *partitionConsumer) MessageReceived(response
*pb.CommandMessage, header
return err
}
- uncompressedHeadersAndPayload, err := pc.Decompress(msgMeta,
headersAndPayload)
+ decryptedPayload, err :=
pc.decryptor.Decrypt(headersAndPayload.ReadableSlice(), pbMsgID, msgMeta)
+ messages := make([]*message, 0)
+
+ // error decrypting the payload
+ if err != nil {
+ pc.log.Error(err)
+ switch pc.decryptor.CryptoFailureAction() {
+ case crypto.ConsumerCryptoFailureActionFail:
+ pc.log.Errorf("consuming message failed due to
decryption err :%v", err)
Review comment:
### java client
The purpose of java client adding msg id to `tracker` is to trigger
redelivery of message request to broker, so that the message can be resent.
If it is not added to tracker it will not be resent to the consumer until
it restarted. And this tracker will be active only if
[ackTimeoutMillis](https://pulsar.apache.org/docs/en/client-libraries-java/#configure-consumer)
config is provided.
## go client
> I don't think we have this so may we just need to ack the message so it's
not resent?
If we leave the changes as it is in this PR, i.e not adding msg id to
tracker (since this client doesn't support this) => the message will not be
resent.
As per [Acknowledgement
timeout](https://pulsar.apache.org/docs/en/concepts-messaging/#acknowledgement-timeout)
this doc, if we want to redeliver message then it is preferable to use
negative acknowledgements over acknowledgement timeout. Java client is doing
the later one(i.e triggering redelivery of message request on ack timeout).
So to be able to resent the message, we can do Nack (negative
acknowledgement).
@cckellogg what do you suggest ?
--
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]