Skip to content
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

feature: support grpc protocol #6754

Closed

Conversation

PleaseGiveMeTheCoke
Copy link
Contributor

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

support grpc/http2 in seata server

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@funky-eyes funky-eyes changed the title grpc protocol feature: support grpc protocol Aug 14, 2024
@funky-eyes funky-eyes added this to the 2.x Backlog milestone Aug 28, 2024
funky-eyes and others added 3 commits August 28, 2024 15:11
# Conflicts:
#	core/src/main/java/org/apache/seata/core/serializer/SerializerServiceLoader.java
Copy link

codecov bot commented Aug 31, 2024

Codecov Report

Attention: Patch coverage is 22.28261% with 143 lines in your changes missing coverage. Please review.

Project coverage is 52.29%. Comparing base (77c81d5) to head (894f24e).

Files with missing lines Patch % Lines
.../apache/seata/core/rpc/netty/grpc/GrpcDecoder.java 0.00% 36 Missing ⚠️
.../apache/seata/core/rpc/netty/grpc/GrpcEncoder.java 0.00% 33 Missing ⚠️
...ache/seata/serializer/protobuf/GrpcSerializer.java 0.00% 17 Missing ⚠️
...che/seata/core/rpc/netty/NettyClientBootstrap.java 21.05% 13 Missing and 2 partials ⚠️
...he/seata/core/protocol/detector/Http2Detector.java 27.77% 12 Missing and 1 partial ⚠️
...seata/core/serializer/SerializerServiceLoader.java 8.33% 11 Missing ⚠️
...he/seata/core/rpc/netty/ProtocolDetectHandler.java 63.15% 6 Missing and 1 partial ⚠️
...ache/seata/core/rpc/netty/grpc/GrpcHeaderEnum.java 0.00% 7 Missing ⚠️
...he/seata/core/protocol/detector/SeataDetector.java 66.66% 2 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #6754      +/-   ##
============================================
- Coverage     52.33%   52.29%   -0.05%     
- Complexity     6375     6401      +26     
============================================
  Files          1079     1087       +8     
  Lines         37462    37636     +174     
  Branches       4437     4452      +15     
============================================
+ Hits          19607    19683      +76     
- Misses        15923    16011      +88     
- Partials       1932     1942      +10     
Files with missing lines Coverage Δ
...ava/org/apache/seata/common/ConfigurationKeys.java 0.00% <ø> (ø)
...in/java/org/apache/seata/common/DefaultValues.java 0.00% <ø> (ø)
.../java/org/apache/seata/core/protocol/Protocol.java 100.00% <100.00%> (ø)
...apache/seata/core/rpc/netty/NettyClientConfig.java 54.41% <100.00%> (+0.68%) ⬆️
...che/seata/core/rpc/netty/NettyServerBootstrap.java 59.09% <100.00%> (-0.46%) ⬇️
...g/apache/seata/core/serializer/SerializerType.java 68.18% <100.00%> (+1.51%) ⬆️
...he/seata/core/protocol/detector/SeataDetector.java 66.66% <66.66%> (ø)
...he/seata/core/rpc/netty/ProtocolDetectHandler.java 63.15% <63.15%> (ø)
...ache/seata/core/rpc/netty/grpc/GrpcHeaderEnum.java 0.00% <0.00%> (ø)
...seata/core/serializer/SerializerServiceLoader.java 43.90% <8.33%> (-16.10%) ⬇️
... and 5 more

... and 8 files with indirect coverage changes

@funky-eyes funky-eyes modified the milestones: 2.x Backlog, 2.3.0 Sep 23, 2024
ctx.writeAndFlush(new DefaultHttp2HeadersFrame(headers));
}

Serializer serializer = SerializerServiceLoader.load(SerializerType.getByCode(SerializerType.GRPC.getCode()), (byte) 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该将序列化类型写入header,然后decode的时候从header读取,这样便于扩展
The serialization type should be written to the header, and then read from the header when decoding, which is easy to expand

@funky-eyes funky-eyes removed this from the 2.3.0 milestone Oct 5, 2024
@funky-eyes funky-eyes closed this Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants