PavelZeger commented on code in PR #1490:
URL: https://github.com/apache/pulsar-client-go/pull/1490#discussion_r3212847612


##########
pulsar/consumer.go:
##########
@@ -222,6 +222,18 @@ type ConsumerOptions struct {
        // MaxReconnectToBroker sets the maximum retry number of 
reconnectToBroker. (default: ultimate)
        MaxReconnectToBroker *uint
 
+       // MaxReconnectToBrokerListener is called when the consumer exhausts 
all reconnect attempts
+       // set by MaxReconnectToBroker. The consumer argument is the parent 
consumer, and err is the
+       // last connection error. Use this callback to detect silent failure 
and take recovery action
+       // (e.g. recreate the consumer). Only fires when MaxReconnectToBroker 
is set to a finite value
+       // or when the backoff policy signals IsMaxBackoffReached.
+       MaxReconnectToBrokerListener func(consumer Consumer, err error)
+
+       // CloseConsumerOnMaxReconnectToBroker, when true, automatically closes 
the consumer after
+       // exhausting all reconnect attempts. The close happens asynchronously 
after
+       // MaxReconnectToBrokerListener (if set) returns. Default: false.

Review Comment:
   Addressed in the commit instead of committing suggestion because it was 
outdated due to the previous commit.



-- 
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]

Reply via email to