apache / apache/pulsar-client-go
Suggest rewrite `regexConsumer` with inheritance
- Dominant language
- Go
- Stars
- 745
- Forks
- 389
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 3
Description
I'm working on the batch receive feature #840. But before that, I think simplifying the implementation of `regexConsumer` and `multiTopicConsumer` is necessary.
In Java client, [`PatternMultiTopicsConsumerImpl`](https://github.com/apache/pulsar/blob/15a00137012669b0f6fd869ca5dbdf50898242ac/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PatternMultiTopicsConsumerImpl.java) inherits from [`MultiTopicsConsumerImpl`](https://github.com/apache/pulsar/blob/2d6b534ef72824ffb5b2f76568ca8346bbc058c6/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java). But Go client implements [`multiTopicConsumer`](https://github.com/apache/pulsar-client-go/blob/5108332c9dd4cb454c26804304bffb82eeffc713/pulsar/consumer_multitopic.go#L33) and [`regexConsumer`](https://github.com/apache/pulsar-client-go/blob/5108332c9dd4cb454c26804304bffb82eeffc713/pulsar/consumer_regex.go#L39) separately for now.
I suggest rewriting [`regexConsumer`](https://github.com/apache/pulsar-client-go/blob/5108332c9dd4cb454c26804304bffb82eeffc713/pulsar/consumer_regex.go#L39) with inheritance just like Java client. If so, further feature development could be easier.
Feel free to correct me if my understanding is inaccurate. cc @wolfstudy @merlimat @nodece
Contributor guide
Research direction
Start by reading pulsar/consumer_regex.go and pulsar/consumer_multitopic.go, then compare the linked Java PatternMultiTopicsConsumerImpl and MultiTopicsConsumerImpl implementations. Determine the intended shared structure and confirm how it affects the batch receive work in issue #840. Done means the consumer implementations are simplified in the agreed design without breaking their existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- distributed-systems
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100