-
Notifications
You must be signed in to change notification settings - Fork 910
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
Add gRPC service registration feature in spring-boot-autoconfigure #1749
Add gRPC service registration feature in spring-boot-autoconfigure #1749
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1749 +/- ##
============================================
+ Coverage 71.8% 71.85% +0.04%
- Complexity 8419 8428 +9
============================================
Files 760 761 +1
Lines 33780 33827 +47
Branches 4158 4162 +4
============================================
+ Hits 24255 24305 +50
+ Misses 7420 7405 -15
- Partials 2105 2117 +12
Continue to review full report at Codecov.
|
231d9ae
to
1fef5de
Compare
1fef5de
to
678fef6
Compare
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.
Very nice work! Left just a few minor comments. 👍
...oot-autoconfigure/src/main/java/com/linecorp/armeria/spring/GrpcServiceRegistrationBean.java
Outdated
Show resolved
Hide resolved
Because gradle-scripts takes care that.
Thank you for your comment! The test failed in AppVeyor, but it seems to have nothing to do with the last push, right? |
Yeah, just an issue with AppVeyor. |
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.
👍
* An abstract bean with information for registering a service object. It enables micrometer | ||
* monitoring of the service automatically. | ||
* An abstract bean with information for registering a service object. | ||
* It enables Micrometer metric collection of the service automatically. |
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.
Thanks! 🙇♂️
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.
Great job!
docServiceBuilder, | ||
grpcServiceRegistrationBean.orElseGet(Collections::emptyList), | ||
meterIdPrefixFuncFactory, | ||
armeriaSettings.getDocsPath()); |
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.
nit: Could extract armeriaSettings.getDocsPath()
as a variable and reuse it?
return exampleRequest; | ||
} | ||
|
||
public static ExampleRequest of(String serviceType, String methodName, Object exampleRequest) { |
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.
nit: Could add @NotNull
to all parameters?
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.
Great job!
@matsumana Would you mind resolving the conflict and addressing @minwoox's comments? |
Updated! |
Thanks, @matsumana ! |
Thank you! |
is it possible to config with the DocServiceBuilder? |
…ine#1749) Motivation: - Makes it easy to configure gRPC server in Spring Boot applications Modifications: - Add `GrpcServiceRegistrationBean.java` - Add `configureGrpcServices` method in `ArmeriaConfigurationUtil.java` then call it in `ArmeriaAutoConfiguration.java` and `ArmeriaReactiveWebServerFactory.java` Result: - It can be configured as follows ```java @bean public GrpcServiceRegistrationBean helloService() { return new GrpcServiceRegistrationBean() .setServiceName("helloService") .setService(new GrpcServiceBuilder() .addService(new HelloService()) .supportedSerializationFormats( GrpcSerializationFormats.values()) .enableUnframedRequests(true) .build()) .setDecorators(LoggingService.newDecorator()) .setExampleRequests(List.of(ExampleRequest.of(HelloServiceGrpc.SERVICE_NAME, "Hello", HelloRequest.newBuilder() .setName("Armeria") .build()))); } ```
Hello, I've added gRPC service registration feature in spring-boot-autoconfigure
Motivation:
Modifications:
GrpcServiceRegistrationBean.java
configureGrpcServices
method inArmeriaConfigurationUtil.java
then call it inArmeriaAutoConfiguration.java
andArmeriaReactiveWebServerFactory.java
Result: