Skip to content

Commit

Permalink
release 4.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
afurer committed Aug 28, 2022
1 parent 7a86b5d commit bfe1ccc
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 26 deletions.
50 changes: 26 additions & 24 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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'
}
Expand All @@ -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.

Expand All @@ -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"
}
}
}
Expand Down Expand Up @@ -334,15 +334,17 @@ Make sure to read <<Interceptors ordering>> 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:
Expand All @@ -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]).

Expand All @@ -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 <<Implementing message validation>> for configuration details.

=== Spring cloud stream support
Expand Down Expand Up @@ -514,17 +516,17 @@ public class HelloService extends GreeterGrpc.GreeterImplBase{
@Override
public void sayHello(GreeterOuterClass.HelloRequest request, StreamObserver<GreeterOuterClass.HelloReply> 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){
Expand Down Expand Up @@ -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<Authentication> 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
Expand Down Expand Up @@ -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>
}
}
Expand Down
8 changes: 8 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -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 |
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion grpc-spring-boot-starter-gradle-plugin/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
----
Expand Down

0 comments on commit bfe1ccc

Please sign in to comment.