pulsar-client-go icon indicating copy to clipboard operation
pulsar-client-go copied to clipboard

[Issue 496] Support for correct reconnections limit in consumer

Open omnilight opened this issue 4 years ago • 11 comments

Fixes #496

Motivation

Ability to set maximum number of reconnections to broker for consumer without consumer been stuck

Modifications

  • Added new method Closed() <-chan struct to consumer interface to be able to control if consumer is closed when using its Chan() method
  • For partitioned consumer added call of the parent's Close() method in case when number of reconnections is limited. This fixes problem when consumer stuck in disconnected state.

Verifying this change

This change added tests and can be verified as follows:

  • Added test for consumer closing on reaching max reconnection count
  • Added test for new Closed() method

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not documented)

omnilight avatar Mar 28 '21 10:03 omnilight

Added fix to prevent possible panic when pulsar returns error in consumer initialization step

omnilight avatar Aug 24 '21 08:08 omnilight

@wolfstudy Hi, could you please review this PR?

omnilight avatar Nov 24 '21 15:11 omnilight

Hello, do we have any ETA on this issue? Is it still planned for 0.8.0? Started using this lib recently and need this functionality badly

clawfinger avatar Dec 23 '21 14:12 clawfinger

I also think this PR is important. I frequently find my consumer code stucked without knowing the underlying maximum number of reconnection had been reached.

rueian avatar Jan 03 '22 07:01 rueian

@wolfstudy Could you please release this fix within the 0.9.0 release?

omnilight avatar Feb 25 '22 15:02 omnilight

@wolfstudy Sorry for annoying you, but is it possible to include this PR into next release?

omnilight avatar May 04 '22 05:05 omnilight

@wolfstudy Hi! Any changes should be made to accept this pr?

omnilight avatar Jun 24 '22 11:06 omnilight