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
Support GRPC #716
Support GRPC #716
Conversation
…ent can use the same interfaceID like other protocols. Use it by: 1. Add this build plugin to pom.xml, com.dib.maven.plugins:hack-modifier-maven-plugin:1.0-SNAPSHOT, which hacks GRPC code generations. 2. Use "SomeServiceGrpc" as interfaceID for both server and client, e.g. GreeterGrpc.class.getName()
Welcome Please sign CLA! Contributor License Agreement! After we will automatically Sync the status of this Pull Request in Three Minutes |
Looks it because of the maven plugin not downloaded. I'm fixing that. |
Build issue fixed. Please review. |
@ujjboy any progress with code review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will continue to review this pr when I have time.
core/api/src/main/java/com/alipay/sofa/rpc/config/ConsumerConfig.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/alipay/sofa/rpc/grpc/examples/registry/GrpcClientRegistryApplication.java
Outdated
Show resolved
Hide resolved
import com.alipay.sofa.rpc.core.exception.SofaRpcRuntimeException; | ||
|
||
import com.alipay.sofa.rpc.core.request.SofaRequest; | ||
import com.alipay.sofa.rpc.core.response.SofaResponse; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
format imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will make change accordingly.
super(consumerConfig); | ||
this.interfaceID = consumerConfig.getInterfaceId(); | ||
String[] segments = this.interfaceID.split("\\."); | ||
String lastSegment = segments[segments.length - 1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use method lastIndexOf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will make change to use method lastIndexOf
…t; branch 'neokidd_dib_grpc' of github.com:neokidd/sofa-rpc into neokidd_dib_grpc
please change version to 5.6.3-SNAPSHOT fix the build problem ,we will merge It into 5.6.3 |
Crazily busy recently, I will try to look into this over this weekend. |
Codecov Report
@@ Coverage Diff @@
## master #716 +/- ##
=========================================
Coverage ? 72.03%
Complexity ? 1084
=========================================
Files ? 376
Lines ? 15347
Branches ? 2445
=========================================
Hits ? 11055
Misses ? 3027
Partials ? 1265
Continue to review full report at Codecov.
|
Done with requested changes. |
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Motivation:
Support GRPC. It is based on #383. But managed to use different ways to get proxy.
Modification:
Comparing to #383, this support of GRPC uses a different approach to make proxy. It hacks byte code to allow extending GPRC interface. In this way, implementation looks more straight forward. Using this support of GRPC is also more naturally like other SOFA supported protocols.
It keeps minimal changes to core-implement. Only important change to core is a small change allowing GRPC proxy to pass interface check.
It's merged with the latest master. No conflicts. Ready for PR.
Result:
Based on #383. Fixes its conflict issues, as a different approach is used.
It adds GRPC support as an extension. Minimal touch to core.