shibd commented on code in PR #972:
URL: https://github.com/apache/pulsar-client-go/pull/972#discussion_r1126174434
##########
pulsar/consumer_impl.go:
##########
@@ -580,12 +583,12 @@ func (c *consumer) ReconsumeLaterWithCustomProperties(msg
Message, customPropert
}
func (c *consumer) Nack(msg Message) {
+ if !checkMessageIDType(msg.ID()) {
+ c.log.Warnf("invalid message id type %T", msg.ID())
+ return
+ }
if c.options.EnableDefaultNackBackoffPolicy ||
c.options.NackBackoffPolicy != nil {
mid := c.messageID(msg.ID())
- if mid == nil {
Review Comment:
Even if we check the type of msgID, we can't remove this check, because
there is other logic that returns `nil`
https://github.com/apache/pulsar-client-go/blob/48b7d0195327a81f638a3c51df2010d7eb244bbe/pulsar/consumer_impl.go#L755-L759
We can add `checkMessageIdType` to `c. messageID` method, and keep this
check.
--
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]