Skip to content

Commit 77ac501

Browse files
author
Alexander Furer
committed
Releasing v. 1.0.0 + docs
1 parent 693a69a commit 77ac501

File tree

2 files changed

+44
-6
lines changed

2 files changed

+44
-6
lines changed

README.adoc

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repositories {
1616
1717
}
1818
dependencies {
19-
compile('org.lognet:grpc-spring-boot-starter:0.0.7')
19+
compile('org.lognet:grpc-spring-boot-starter:1.0.0')
2020
}
2121
----
2222
@@ -122,11 +122,49 @@ public class GreeterService extends GreeterGrpc.GreeterImplBase{
122122

123123

124124

125-
== On the roadmap
125+
=== Custom gRPC Server Configuration
126126

127-
* Customized gRPC server builder with compression/decompression registry .
128-
* Custom `Executor` service.
129-
* Transport security.
127+
To intercept the `io.grpc.ServerBuilder` instance used to build the `io.grpc.Server`, you can add bean that inherits from `org.lognet.springboot.grpc.GRpcServerBuilderConfigurer` to your context and override the `configure` method. +
128+
By the time of invocation of `configure` method, all discovered services, including theirs interceptors, had been added to the passed builder. +
129+
In your implementation of `configure` method, you can continue with passed instance of `ServerBuilder` by addition your configuration:
130+
131+
[source,java]
132+
----
133+
@Bean
134+
public MyGRpcServerBuilderConfigurer extends GRpcServerBuilderConfigurer(){
135+
@Override
136+
public ServerBuilder<?> configure(ServerBuilder<?> serverBuilder){
137+
return serverBuilder
138+
.executor(YOUR EXECUTOR INSTANCE)
139+
.compressorRegistry(YOUR COMPRESSION REGISTRY)
140+
.decompressorRegistry(YOUR DECOMPRESSION REGISTRY)
141+
.useTransportSecurity(YOUR TRANSPORT SECURITY SETTINGS);
142+
143+
}
144+
};
145+
}
146+
----
147+
148+
or return completely new instance of `ServerBuilder` :
149+
150+
[source,java]
151+
----
152+
@Bean
153+
public MyGRpcServerBuilderConfigurer extends GRpcServerBuilderConfigurer(){
154+
@Override
155+
public ServerBuilder<?> configure(ServerBuilder<?> serverBuilder){
156+
return ServerBuilder.forPort(YOUR PORT)
157+
.executor(YOUR EXECUTOR INSTANCE)
158+
.compressorRegistry(YOUR COMPRESSION REGISTRY)
159+
.decompressorRegistry(YOUR DECOMPRESSION REGISTRY)
160+
.useTransportSecurity(YOUR TRANSPORT SECURITY SETTINGS);
161+
162+
}
163+
};
164+
}
165+
----
166+
[NOTE]
167+
In this case you should also take care about adding the services to the fresh instance of `ServerBuilder`
130168

131169
== License
132170

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=0.0.8-SNAPSHOT
1+
version=1.0.0
22
group=org.lognet
33
description=Spring Boot starter for Google RPC.
44
gitHubUrl=https\://github.com/LogNet/grpc-spring-boot-starter

0 commit comments

Comments
 (0)