apache / apache/pulsar-client-go

MaxReconnectToBroker is useless for consumer

Open
#496 7 comments 3 reactions 1 assignee Claimed by @omnilight View on GitHub
Dominant language
Go
Stars
745
Forks
389
Avg merge
3d 20h
Merged PRs (30d)
3

Description

#### 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](https://github.com/apache/pulsar-client-go/blob/master/pulsar/consumer_partition.go#L861) just exists leaving consumer useless

#### Steps to reproduce

1. Set option to `ConsumerOptions.MaxReconnectToBroker = 2`
2. Begin consuming messages
3. Do something with broker (say, stop it)
4. Messages would stop consuming
5. Start broker
6. Messages won't appear because consumer would not reconnect

#### System configuration
**Pulsar version**: 2.7

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.