apache / apache/incubator-seata

io.seata.core.rpc.netty.NettyRemotingServer#registerProcessor代码建议优化

Open
#3,758 4 comments 0 reactions 0 assignees View on GitHub
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.
![%LMS_ {4WZXV2L5`V7S}GFO](https://user-images.githubusercontent.com/49663418/118951991-21e3bd80-b98e-11eb-9ac9-adb56497070e.png)

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.