Fo Example:
func handler(msg jetstream.Msg) {
err := doWork()
if err != nil {
_ = msg.NakWithDelay(time.Second * 10)
}
_ = msg.Ack()
}
I would like to get the current number of attempts to process the message msg jetstream.Msg in order to create a timeout with progression. How can I do it?
i guess, it would be local variable for counting.
just find the point in ur code, where it can failes when it tries to process the message, and handle the return err (it should return non-zero value of type error) and if it happens, just increase the counter and handle that counter how u want eg.: