@@ -85,27 +85,25 @@ HTTP/1.1 200 OK
85
85
}
86
86
```
87
87
88
- ---
89
-
90
- The library works with all ScalaPB-based GRPC code-generators:
91
-
92
- * [ ScalaPB] ( https://scalapb.github.io ) services with ` Future ` monad
93
- * [ fs2-grpc] ( https://github.com/typelevel/fs2-grpc ) , built on top of ` cats-effect ` and ` fs2 `
94
- * [ ZIO gRPC] ( https://scalapb.github.io/zio-grpc/ ) , built on top of ` ZIO `
88
+ ## Use cases
95
89
96
- At the moment, only unary (non-streaming) methods are supported.
90
+ * Expose existing gRPC-services as REST APIs without modifying the original application code, alongside gRPC. gRPC
91
+ services are used for inter-service communication, while ConnectRPC REST APIs are exposed for external clients who
92
+ speak traditional HTTP with JSON instead of binary protobuf (browsers, for example).
93
+ * Use ConnectRPC protocol for both inter-service and external traffic (fully ditch gRPC as communication protocol),
94
+ while keeping the original gRPC service interfaces (easy switch to ConnectRPC with no changes into application code).
97
95
98
96
## Architecture
99
97
100
98
![ Layered architecture] ( docs/layered-architecture.svg )
101
99
102
- The diagram above shows the high level architecture:
100
+ The diagram above shows how ` connect-rpc-scala ` fits into the overall architecture:
103
101
104
102
* Code generation libraries generate code from protobuf definitions. The code is used by the application layer to
105
103
communicate with other services / implement the logic.
106
104
* Under the hood generated code uses gRPC abstractions, such as ` Channel ` , ` ServiceDefinition ` , ` Stub ` , etc.
107
- * The ` connect-rpc-scala ` library implements those gRPC abstractions, unblocking use of the ConnectRPC protocol
108
- to communicate with other services / expose ConnectRPC servers.
105
+ * The ` connect-rpc-scala ` library implements those gRPC abstractions, unblocking reuse of the same
106
+ application code for both gRPC & ConnectRPC protocol servers (see the Use Cases section) .
109
107
* Under the hood the library uses ` http4s ` or ` netty ` clients/servers to expose protobuf-based services as REST APIs.
110
108
111
109
The library provides two frontends:
@@ -155,6 +153,12 @@ Built-in [GRPC Transcoding](https://cloud.google.com/endpoints/docs/grpc/transco
155
153
| - Request body field mapping, e.g. <br />` body: "request" ` , ` body: "*" ` | ✅ | ➖ |
156
154
| - Path suffixes, e.g., ` /v1/{name=projects/*/locations/*}/datasets ` | ➖ | ➖ |
157
155
156
+ The library works with all ScalaPB code-generators:
157
+
158
+ * [ ScalaPB] ( https://scalapb.github.io ) services with ` Future ` monad
159
+ * [ fs2-grpc] ( https://github.com/typelevel/fs2-grpc ) for ` cats-effect ` /` fs2 `
160
+ * [ zio-grpc] ( https://scalapb.github.io/zio-grpc/ ) for ` ZIO `
161
+
158
162
## Usage
159
163
160
164
![ Maven Central] ( https://img.shields.io/maven-central/v/me.ivovk/connect-rpc-scala-core_3?style=flat-square&color=green )
0 commit comments