@@ -22,7 +22,7 @@ Best viewed with image:https://www.octotree.io/_nuxt/img/03e72a3.svg["Octoree",w
2222
2323== Features
2424
25- Auto-configures and runs the embedded gRPC server with @GRpcService-enabled beans as part of spring-boot application (https://github.com/LogNet/grpc-spring-boot-starter/blob/master/images/demo.gif[short video])
25+ Autoconfigures and runs the embedded gRPC server with @GRpcService-enabled beans as part of spring-boot application (https://github.com/LogNet/grpc-spring-boot-starter/blob/master/images/demo.gif[short video])
2626
2727== Setup
2828
@@ -38,7 +38,7 @@ repositories {
3838
3939}
4040dependencies {
41- compile 'io.github.lognet:grpc-spring-boot-starter:4.8.0 '
41+ compile 'io.github.lognet:grpc-spring-boot-starter:4.8.1 '
4242}
4343
4444
@@ -48,10 +48,10 @@ By default, starter pulls `io.grpc:grpc-netty-shaded` as transitive dependency
4848
4949[source,groovy]
5050----
51- compile ('io.github.lognet:grpc-spring-boot-starter:4.8.0 ') {
51+ compile ('io.github.lognet:grpc-spring-boot-starter:4.8.1 ') {
5252 exclude group: 'io.grpc', module: 'grpc-netty-shaded'
5353 }
54- compile 'io.grpc:grpc-netty:1.47 .0' // <1>
54+ compile 'io.grpc:grpc-netty:1.49 .0' // <1>
5555----
5656<1> Make sure to pull the version that matches the release.
5757
@@ -65,7 +65,7 @@ In this case you'll need to forcibly and explicitly set the `grpc` version to
6565configurations.all {
6666 resolutionStrategy.eachDependency { details ->
6767 if ("io.grpc".equalsIgnoreCase(details.requested.group)) {
68- details.useVersion "1.47 .0"
68+ details.useVersion "1.49 .0"
6969 }
7070 }
7171}
@@ -334,15 +334,17 @@ Make sure to read <<Interceptors ordering>> chapter.
334334
335335Make sure to include below dependencies :
336336
337- ```
337+ [source]
338+ ----
338339implementation "org.springframework.boot:spring-boot-starter-actuator"
339340implementation "io.micrometer:micrometer-registry-prometheus"
340341implementation 'org.springframework.boot:spring-boot-starter-web'
341- ```
342+ ----
342343
343344Configuration :
344345
345- ```yml
346+ [source,yml]
347+ ----
346348management:
347349 metrics:
348350 export:
@@ -352,7 +354,7 @@ management:
352354 web:
353355 exposure:
354356 include: "*"
355- ```
357+ ----
356358
357359Standard `/actuator/metrics` and `/actuator/prometheus` endpoints will render `grpc.server.calls` metrics (see demo https://github.com/LogNet/grpc-spring-boot-starter/blob/master/grpc-spring-boot-starter-demo/src/test/java/org/lognet/springboot/grpc/DemoAppTest.java[here]).
358360
@@ -361,7 +363,7 @@ GRPC scrapping https://github.com/prometheus/prometheus/issues/8414[proposal]
361363
362364=== Spring Boot Validation support
363365
364- The starter can be auto-configured to validate request/response gRPC service messages.
366+ The starter can be autoconfigured to validate request/response gRPC service messages.
365367Please continue to <<Implementing message validation>> for configuration details.
366368
367369=== Spring cloud stream support
@@ -514,17 +516,17 @@ public class HelloService extends GreeterGrpc.GreeterImplBase{
514516 @Override
515517 public void sayHello(GreeterOuterClass.HelloRequest request, StreamObserver<GreeterOuterClass.HelloReply> responseObserver) {
516518 ...
517- throw new GRpcRuntimeExceptionWrapper(new SomeException()) ; <1>
519+ throw new GRpcRuntimeExceptionWrapper(new SomeException()) ; // <1>
518520//or
519- throw new GRpcRuntimeExceptionWrapper(new SomeException(),"myHint") <2>
521+ throw new GRpcRuntimeExceptionWrapper(new SomeException(),"myHint");// <2>
520522//or
521- throw new SomeRuntimeException() <3>
523+ throw new SomeRuntimeException(); // <3>
522524 }
523525 @GRpcExceptionHandler
524526 public Status privateHandler (SomeException npe,GRpcExceptionScope scope){
525527 // INVOKED when thrown from HelloService service
526- String myHint = scope.getHintAs(String.class); <4>
527- scope.getResponseHeaders().put(Metadata.Key.of("custom", Metadata.ASCII_STRING_MARSHALLER), "Value"); <5>
528+ String myHint = scope.getHintAs(String.class); // <4>
529+ scope.getResponseHeaders().put(Metadata.Key.of("custom", Metadata.ASCII_STRING_MARSHALLER), "Value");// <5>
528530 }
529531 @GRpcExceptionHandler
530532 public Status privateHandler (SomeRuntimeException npe,GRpcExceptionScope scope){
@@ -788,20 +790,20 @@ One is possible to plug in your own bespoke authentication provider by implement
788790 @Override
789791 public void configure(GrpcSecurity builder) throws Exception {
790792 builder.authorizeRequests()
791- .anyMethod().authenticated()<1>
793+ .anyMethod().authenticated()// <1>
792794 .and()
793- .authenticationSchemeSelector(new AuthenticationSchemeSelector() { <2>
795+ .authenticationSchemeSelector(new AuthenticationSchemeSelector() { // <2>
794796 @Override
795797 public Optional<Authentication> getAuthScheme(CharSequence authorization) {
796- return new MyAuthenticationObject(); <3>
798+ return new MyAuthenticationObject();// <3>
797799 }
798800 })
799- .authenticationProvider(new AuthenticationProvider() { <4>
801+ .authenticationProvider(new AuthenticationProvider() {// <4>
800802 @Override
801803 public Authentication authenticate(Authentication authentication) throws AuthenticationException {
802804 MyAuthenticationObject myAuth= (MyAuthenticationObject)authentication;
803805 //validate myAuth
804- return MyValidatedAuthenticationObject(withAuthorities);<5>
806+ return MyValidatedAuthenticationObject(withAuthorities);// <5>
805807 }
806808
807809 @Override
@@ -1176,12 +1178,12 @@ public class GreeterServiceConsumer {
11761178 private EurekaClient client;
11771179
11781180 public void greet(String name) {
1179- final InstanceInfo instanceInfo = client.getNextServerFromEureka("my-service-name", false);<1>
1181+ final InstanceInfo instanceInfo = client.getNextServerFromEureka("my-service-name", false);// <1>
11801182 final ManagedChannel channel = ManagedChannelBuilder.forAddress(instanceInfo.getIPAddr(), instanceInfo.getPort())
11811183 .usePlaintext()
1182- .build(); <2>
1183- final GreeterServiceGrpc.GreeterServiceFutureStub stub = GreeterServiceGrpc.newFutureStub(channel); <3>
1184- stub.greet(name); <4>
1184+ .build(); // <2>
1185+ final GreeterServiceGrpc.GreeterServiceFutureStub stub = GreeterServiceGrpc.newFutureStub(channel); // <3>
1186+ stub.greet(name); // <4>
11851187
11861188 }
11871189}
0 commit comments