MaxReconnectToBroker is useless for consumer
Expected behavior
When we set ConsumerOptions.MaxReconnectToBroker to some value other than infinite, then when reconnection count reaches this value consumer should return with an error.
Actual behavior
Consumer just stuck, because reconnectToBroker just exists leaving consumer useless
Steps to reproduce
- Set option to
ConsumerOptions.MaxReconnectToBroker = 2 - Begin consuming messages
- Do something with broker (say, stop it)
- Messages would stop consuming
- Start broker
- Messages won't appear because consumer would not reconnect
System configuration
Pulsar version: 2.7
Added pull request with fix
I think this is what MaxReconnectToBroker means, it won't try to reconnect to broker after given MaxReconnectToBroker tries. 😄
By the way, we do need to close useless consumer when we are not trying to reconnect to broker.
Yes, but in the case it stops reconnecting consumer will just stuck and no notification would be passed to the caller. In the pr I've added closing consumer in this case. For me that seems valid behaviour
@wolfstudy Hi! Sorry for direct mention, but could we proceed with this issue in any way?
@wolfstudy Hi! Sorry for direct mention, but could we proceed with this issue in any way?
Thanks @omnilight work for this, agree with you.
Are there any plans for this PR to be included in a release at some point? We're suffering a little bit from this bug :)
@wolfstudy friendly ping
@wolfstudy any updates on that please? We struggle with that behavior