Feature - implement reference count for ConsumerImpl (#3795)
* Feature - implement reference count for ConsumerImpl Add reference count for ConsumerImpl in order to track reused instances of a consumer instance returned by `subscribe()` method call. Having the reference of subscribed consumer instances offers the ability to not close a consumer until the last corresponding `close()` is being called. Modifications: - Add field on ConsumerBase to track references of consumer instances subscribed by the user. - Add checks on ConsumerImpl to know whether close() action should be performed regarding of reference count being zero value. - Increment reference count when a previous built consumer instance is being used by caller. Future considerations: When optimization #3312 is going to be made for other consumers implementation aside from ConsumerImpl it should add refCount checks on close() method call. * Add tests for reference count on ConsumerImpl - Add test to verify ConsumerImpl reference count on close() method. - Fix test from dup consumers feature with refcount.
Showing
想要评论请 注册 或 登录