apache / apache/incubator-seata
io.seata.core.rpc.netty.NettyRemotingServer#registerProcessor代码建议优化
- Dominant language
- Java
- Stars
- 26k
- Forks
- 8.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 4
Description
## Why you need it?
Is your feature request related to a problem? Please describe in details
将硬性编码转成用SPI进行解耦和扩展,使用getMessageTypes()方法来获取类型,进行注册到processorTable中
## How it could be?
A clear and concise description of what you want to happen. You can explain more about input of the feature, and output of it.
`List processors = ServicLoader.load(RemotingProcessor.class);
.....
`
## Other related information
Add any other context or screenshots about the feature request here.

Contributor guide
Research direction
Start at io.seata.core.rpc.netty.NettyRemotingServer#registerProcessor and inspect how RemotingProcessor instances and processorTable are currently handled. Review the proposed ServiceLoader flow and getMessageTypes(); done means processor implementations can be discovered through SPI and their message types are registered correctly without the existing hard-coded coupling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, distributed-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100