From bfe1ccc3c953d761f12c7939983924b844eb85dd Mon Sep 17 00:00:00 2001 From: Alexander Furer Date: Sun, 28 Aug 2022 12:43:11 +0300 Subject: [PATCH] release 4.8.1 --- README.adoc | 50 ++++++++++--------- ReleaseNotes.md | 8 +++ gradle.properties | 2 +- .../README.adoc | 2 +- 4 files changed, 36 insertions(+), 26 deletions(-) diff --git a/README.adoc b/README.adoc index ae8c3f8..aaca13b 100644 --- a/README.adoc +++ b/README.adoc @@ -22,7 +22,7 @@ Best viewed with image:https://www.octotree.io/_nuxt/img/03e72a3.svg["Octoree",w == Features -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]) +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]) == Setup @@ -38,7 +38,7 @@ repositories { } dependencies { - compile 'io.github.lognet:grpc-spring-boot-starter:4.8.0' + compile 'io.github.lognet:grpc-spring-boot-starter:4.8.1' } @@ -48,10 +48,10 @@ By default, starter pulls `io.grpc:grpc-netty-shaded` as transitive dependency [source,groovy] ---- - compile ('io.github.lognet:grpc-spring-boot-starter:4.8.0') { + compile ('io.github.lognet:grpc-spring-boot-starter:4.8.1') { exclude group: 'io.grpc', module: 'grpc-netty-shaded' } - compile 'io.grpc:grpc-netty:1.47.0' // <1> + compile 'io.grpc:grpc-netty:1.49.0' // <1> ---- <1> Make sure to pull the version that matches the release. @@ -65,7 +65,7 @@ In this case you'll need to forcibly and explicitly set the `grpc` version to configurations.all { resolutionStrategy.eachDependency { details -> if ("io.grpc".equalsIgnoreCase(details.requested.group)) { - details.useVersion "1.47.0" + details.useVersion "1.49.0" } } } @@ -334,15 +334,17 @@ Make sure to read <> chapter. Make sure to include below dependencies : -``` +[source] +---- implementation "org.springframework.boot:spring-boot-starter-actuator" implementation "io.micrometer:micrometer-registry-prometheus" implementation 'org.springframework.boot:spring-boot-starter-web' -``` +---- Configuration : -```yml +[source,yml] +---- management: metrics: export: @@ -352,7 +354,7 @@ management: web: exposure: include: "*" -``` +---- Standard `/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]). @@ -361,7 +363,7 @@ GRPC scrapping https://github.com/prometheus/prometheus/issues/8414[proposal] === Spring Boot Validation support -The starter can be auto-configured to validate request/response gRPC service messages. +The starter can be autoconfigured to validate request/response gRPC service messages. Please continue to <> for configuration details. === Spring cloud stream support @@ -514,17 +516,17 @@ public class HelloService extends GreeterGrpc.GreeterImplBase{ @Override public void sayHello(GreeterOuterClass.HelloRequest request, StreamObserver responseObserver) { ... - throw new GRpcRuntimeExceptionWrapper(new SomeException()) ; <1> + throw new GRpcRuntimeExceptionWrapper(new SomeException()) ; // <1> //or - throw new GRpcRuntimeExceptionWrapper(new SomeException(),"myHint") <2> + throw new GRpcRuntimeExceptionWrapper(new SomeException(),"myHint");// <2> //or - throw new SomeRuntimeException() <3> + throw new SomeRuntimeException(); //<3> } @GRpcExceptionHandler public Status privateHandler (SomeException npe,GRpcExceptionScope scope){ // INVOKED when thrown from HelloService service - String myHint = scope.getHintAs(String.class); <4> - scope.getResponseHeaders().put(Metadata.Key.of("custom", Metadata.ASCII_STRING_MARSHALLER), "Value"); <5> + String myHint = scope.getHintAs(String.class); // <4> + scope.getResponseHeaders().put(Metadata.Key.of("custom", Metadata.ASCII_STRING_MARSHALLER), "Value");// <5> } @GRpcExceptionHandler public Status privateHandler (SomeRuntimeException npe,GRpcExceptionScope scope){ @@ -788,20 +790,20 @@ One is possible to plug in your own bespoke authentication provider by implement @Override public void configure(GrpcSecurity builder) throws Exception { builder.authorizeRequests() - .anyMethod().authenticated()<1> + .anyMethod().authenticated()//<1> .and() - .authenticationSchemeSelector(new AuthenticationSchemeSelector() { <2> + .authenticationSchemeSelector(new AuthenticationSchemeSelector() { //<2> @Override public Optional getAuthScheme(CharSequence authorization) { - return new MyAuthenticationObject(); <3> + return new MyAuthenticationObject();// <3> } }) - .authenticationProvider(new AuthenticationProvider() { <4> + .authenticationProvider(new AuthenticationProvider() {// <4> @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { MyAuthenticationObject myAuth= (MyAuthenticationObject)authentication; //validate myAuth - return MyValidatedAuthenticationObject(withAuthorities);<5> + return MyValidatedAuthenticationObject(withAuthorities);//<5> } @Override @@ -1176,12 +1178,12 @@ public class GreeterServiceConsumer { private EurekaClient client; public void greet(String name) { - final InstanceInfo instanceInfo = client.getNextServerFromEureka("my-service-name", false);<1> + final InstanceInfo instanceInfo = client.getNextServerFromEureka("my-service-name", false);//<1> final ManagedChannel channel = ManagedChannelBuilder.forAddress(instanceInfo.getIPAddr(), instanceInfo.getPort()) .usePlaintext() - .build(); <2> - final GreeterServiceGrpc.GreeterServiceFutureStub stub = GreeterServiceGrpc.newFutureStub(channel); <3> - stub.greet(name); <4> + .build(); //<2> + final GreeterServiceGrpc.GreeterServiceFutureStub stub = GreeterServiceGrpc.newFutureStub(channel); //<3> + stub.greet(name); //<4> } } diff --git a/ReleaseNotes.md b/ReleaseNotes.md index b3c5273..5d1506f 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,5 +1,6 @@ | Starter Version | gRPC versions | Spring Boot version |-------------------------|:-------------:|:-------------------:| +| [4.8.1](#version-480) | 1.49.0 | 2.7.3 | | [4.8.0](#version-480) | 1.47.0 | 2.7.1 | | [4.7.1](#version-471) | 1.47.0 | 2.6.8 | | [4.7.0](#version-470) | 1.45.1 | 2.6.6 | @@ -33,6 +34,13 @@ | [4.0.0](#version-400) | 1.32.1 | 2.3.3.RELEASE | | [3.5.7](#version-357) | 1.31.1 | 1.5.13.RELEASE | +# Version 4.8.1 +## :hammer: Dependency Upgrades + +- Upgrade Spring boot to 2.7.3 [#307](https://github.com/LogNet/grpc-spring-boot-starter/issues/307) +- Upgrade grpc to 1.49 [#305](https://github.com/LogNet/grpc-spring-boot-starter/issues/305) + + # Version 4.8.0 ## :star: New Features diff --git a/gradle.properties b/gradle.properties index 6e02a81..cc0922e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ gradleErrorPronePluginVersion=2.0.2 errorProneVersion=2.7.1 lombokVersion=1.18.20 -version=4.8.1-SNAPSHOT +version=4.8.1 group=io.github.lognet description=Spring Boot starter for Google RPC. gitHubUrl=https\://github.com/LogNet/grpc-spring-boot-starter diff --git a/grpc-spring-boot-starter-gradle-plugin/README.adoc b/grpc-spring-boot-starter-gradle-plugin/README.adoc index 467abd7..9cb6a86 100644 --- a/grpc-spring-boot-starter-gradle-plugin/README.adoc +++ b/grpc-spring-boot-starter-gradle-plugin/README.adoc @@ -23,7 +23,7 @@ Bootstraps the project with `com.google.protobuf` gradle plugin (including `grp ---- plugins { id 'java' - id "io.github.lognet.grpc-spring-boot" version '4.8.0' + id "io.github.lognet.grpc-spring-boot" version '4.8.1' } ----