Skip to content

Commit 55981c9

Browse files
authored
Merge pull request #395 from yidongnan/documentation/stubfactory2
Add extra docs page for the other grpc-java flavors / stub factories
2 parents a6ff30c + 0590abb commit 55981c9

File tree

3 files changed

+71
-7
lines changed

3 files changed

+71
-7
lines changed

README.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,35 @@ README: [English](README.md) | [中文](README-zh-CN.md)
1515

1616
## Features
1717

18-
* Auto configures and runs the embedded gRPC server with `@GrpcService`-enabled beans as part of your spring-boot
19-
application
18+
* Automatically configures and runs the gRPC server with your `@GrpcService` implementations
2019

2120
* Automatically creates and manages your grpc channels and stubs with `@GrpcClient`
2221

23-
* Supports [Spring Cloud](https://spring.io/projects/spring-cloud) (register services to [Consul](https://github.com/spring-cloud/spring-cloud-consul) or [Eureka](https://github.com/spring-cloud/spring-cloud-netflix) or [Nacos](https://github.com/spring-cloud-incubator/spring-cloud-alibaba) and fetch gRPC server information)
24-
25-
* Supports [Spring Sleuth](https://github.com/spring-cloud/spring-cloud-sleuth) as distributed tracing solution (If [brave-instrumentation-grpc](https://mvnrepository.com/artifact/io.zipkin.brave/brave-instrumentation-grpc) is present)
22+
* Supports other grpc-java flavors (e.g.
23+
[Reactive gRPC (RxJava)](https://github.com/salesforce/reactive-grpc/tree/master/rx-java),
24+
[grpc-kotlin](https://github.com/grpc/grpc-kotlin), ...)
25+
* Server-side: Should work for all grpc-java flavors (`io.grpc.BindableService` based)
26+
* Client-side: Requires custom `StubFactory`s\
27+
Currently build-in support:
28+
* grpc-java
29+
* (Please report missing ones, so we can add support for them)
30+
31+
* Supports [Spring-Security](https://github.com/spring-projects/spring-security)
32+
33+
* Supports [Spring Cloud](https://spring.io/projects/spring-cloud)
34+
* Server-side: Adds grpc-port information to the service registration details\
35+
Currently natively supported:
36+
* [Consul](https://github.com/spring-cloud/spring-cloud-consul)
37+
* [Eureka](https://github.com/spring-cloud/spring-cloud-netflix)
38+
* [Nacos](https://github.com/spring-cloud-incubator/spring-cloud-alibaba)
39+
* (Please report missing ones, so we can add support for them)
40+
* Client-side: Reads the service's target addresses from spring's `DiscoveryClient` (all flavors)
41+
42+
* Supports [Spring Sleuth](https://github.com/spring-cloud/spring-cloud-sleuth) as distributed tracing solution\
43+
(If [brave-instrumentation-grpc](https://mvnrepository.com/artifact/io.zipkin.brave/brave-instrumentation-grpc) is present)
2644

2745
* Supports global and custom gRPC server/client interceptors
2846

29-
* [Spring-Security](https://github.com/spring-projects/spring-security) support
30-
3147
* Automatic metric support ([micrometer](https://micrometer.io/)/[actuator](https://github.com/spring-projects/spring-boot/tree/master/spring-boot-project/spring-boot-actuator) based)
3248

3349
* Also works with (non-shaded) grpc-netty
@@ -129,6 +145,7 @@ dependencies {
129145
compile 'net.devh:grpc-client-spring-boot-starter:2.9.0.RELEASE'
130146
}
131147
````
148+
132149
Annotate a field of your grpc client stub with `@GrpcClient(serverName)`
133150

134151
* Do not use in conjunction with `@Autowired` or `@Inject`

docs/en/flavors.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# gRPC-Java Flavors
2+
3+
Aside from [grpc-java](https://github.com/grpc/grpc-java/), this library also supports other java based
4+
grpc-implementations.
5+
6+
| Flavor | Server | Client |
7+
| --- | --- | --- |
8+
| [grpc-java](https://github.com/grpc/grpc-java/) | ✔️ | ✔️ |
9+
| [Reactive gRPC (Reactor)](https://github.com/salesforce/reactive-grpc/tree/master/reactor) | ✔️ | ✏️ |
10+
| [Reactive gRPC (RxJava)](https://github.com/salesforce/reactive-grpc/tree/master/rx-java) | ✔️ | ✏️ |
11+
| [grpc-kotlin](https://github.com/grpc/grpc-kotlin) | ✔️ | ✏️ |
12+
| [ScalaPB](https://scalapb.github.io/grpc.html) | ✔️ | ✏️ |
13+
| [akka-grpc](https://github.com/akka/akka-grpc) | ✔️ | ✏️ |
14+
| ... | ✔️ | ✏️ |
15+
16+
*✔️ = Build-in support* |
17+
*✏️ = Requires customization*
18+
19+
> **Note:** You might require additional dependencies depending on your grpc java flavor.
20+
21+
## Server side
22+
23+
The server side should work without any additional configuration. Just annotatate your implementation of the generated
24+
`BindableService` class with `@GrpcService` and it will be picked up automatically.
25+
26+
See also:
27+
28+
- [Server - Getting Started](server/getting-started.md)
29+
30+
## Client side
31+
32+
The client side requires a `StubFactory` for each type of stub.
33+
34+
This library ships the following stub factory beans by default:
35+
36+
- gRPC-Java
37+
- `AbstractAsyncStub` -> `AsyncStubFactory`
38+
- `AbstractBlockingStub` -> `BlockingStubFactory`
39+
- `AbstractFutureStub` -> `FutureStubFactory`
40+
41+
Please report missing stub types so that we can add support for them.
42+
43+
See also:
44+
45+
- [Client - Getting Started](client/getting-started.md)
46+
- [Client - Configuration - StubFactory](client/configuration.md#stubfactory)

docs/en/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ customization you need for your project.
2323
- Others setups
2424
- [Trouble-Shooting](trouble-shooting.md)
2525
- [Example Projects](examples.md)
26+
- [gRPC-Java Flavors](flavors.md)
2627
- [Version Overview](versions.md)
2728
- [Spring Boot Actuator / Metrics Support](actuator.md)
2829
- [Brave-Tracing / Spring Cloud Sleuth Support](brave.md)

0 commit comments

Comments
 (0)