-
Notifications
You must be signed in to change notification settings - Fork 641
[ISSUE #549] Unify request handler code style of tcp and http protocol #4333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4333 +/- ##
============================================
+ Coverage 17.82% 17.88% +0.05%
- Complexity 1514 1516 +2
============================================
Files 604 603 -1
Lines 25559 25493 -66
Branches 2400 2377 -23
============================================
+ Hits 4556 4559 +3
+ Misses 20564 20496 -68
+ Partials 439 438 -1
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
LGTM |
|
@silentchildh please fix the conflicts. |
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/boot/AbstractTCPServer.java
Show resolved
Hide resolved
…rotocol (apache#4333) * refactor: enhance http and tcp server style * fix: create trace-plugin
Fixes #549
Motivation
boot
Firstly, I divided the server into three layers:
AbstractRemotingServer. It leverages Netty for the most basic communication server.AbstractTcpServerandAbstractHttpServer.EventMeshXxxServerthat integrate multiple capabilities (typically a manager that assembles the capabilities to enhance the server) , such asEventMeshTCPServerand 'EventMeshHTTPServer`.In my opinion, the most important part of the runtime module is the "processor" . The main component of the second-tier server is the "processor" . That is, declare the "processor" required for registration in the Layer 2 server
AbstractXXXServerto build the layer server.In layer 3 server, I prefer pluggable plug-in design. That is, in the process of extending the "processor" , if there is a function that requires other modules, add the manager of the corresponding function in this layer. The processor then retrieves the corresponding manager through the
EventMeshXxxServerinstance.For example :
Registryis provided for cluster deployment of eventmesh servers.Modifications
boot:
AbstractTcpServer. I've used all of Netty's required handlers asAbstracTcpServerinternal classes to better manage this tier of servers.EventMeshHTTPServerThreadPoolGroupto normalize it, the implementation classes of this interface can assemble the required thread pool.core
Documentation