eventmesh
eventmesh copied to clipboard
[Enhancement] Not yet make full use of Polymorphism in Producer and AbstractProducer.
Search before asking
- [X] I had searched in the issues and found no similar issues.
Enhancement Request
- In storage modules of knative, rocketmq, pulsar, kafka, the model of
Producer's hierarchy is not unified and confused: 3AbstractProducers in module knative, rocketmq, pulsar have some similar contents, but some implementProducerand some not. EvenAbstractProducerin kafka is not been designed intoProducer's hierarchy. InterruptedExceptionshould never be ignored. Or the import interrupted state of Thread may be ignored unexpected.- Some logic has been provided by existing util, so no need to code again.
- Smaller
synchronizedscope, lower the thread competitiveness - In AtomicXxx,
set()is thread safe and better than CAS when no need to get a return value.
Describe the solution you'd like
- Unify the model of
Producer's hierarchy: Rename 3AbstractProducerin module knative, rocketmq toKnativeAbstractProducer, RocketmqAbstractProducer. Add aAbstractProducerin api module implementsProducer. MakeAbstractProducers in module knative, kafka, rocketmq, pulsar all extendsAbstractProducerin api module or its sub abstract class. RemoveAbstractProducerin module pulsar. - Catch
InterruptedExceptionand callinterrupt()of current Thread. - Use existing util.
- Minimize
synchronizedscope. - Use
setreplace CAS where no need get a return value.
Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
It has been 90 days since the last activity on this issue. Apache EventMesh values the voices of the community. Please don't hesitate to share your latest insights on this matter at any time, as the community is more than willing to engage in discussions regarding the development and optimization directions of this feature.
If you feel that your issue has been resolved, please feel free to close it. Should you have any additional information to share, you are welcome to reopen this issue.