https://github.com/bcarter97/grpc-echo-server
gRPC server that response with a status after the given delay
https://github.com/bcarter97/grpc-echo-server
grpc
Last synced: about 1 year ago
JSON representation
gRPC server that response with a status after the given delay
- Host: GitHub
- URL: https://github.com/bcarter97/grpc-echo-server
- Owner: bcarter97
- Created: 2024-08-30T12:08:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-08T19:55:57.000Z (about 1 year ago)
- Last Synced: 2025-01-08T20:48:43.332Z (about 1 year ago)
- Topics: grpc
- Language: Scala
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# grpc-echo-server
A simple gRPC server that takes a [Status Code](https://grpc.github.io/grpc/core/md_doc_statuscodes.html) and returns
a response after the configured delay.
If the Status Code is an error (greater than 0), this will be raised as a gRPC error.
## Example
### OK
```shell
grpcurl --emit-defaults -plaintext -d '{"code": 0, "delay": 10}' localhost:4770 io.github.bcarter97.echo.v1.Echo/Echo
{
"code": 0,
"delay": "10"
}
```
### Error
```shell
grpcurl -plaintext -d '{"code": 14, "delay": 500}' localhost:4770 io.github.bcarter97.echo.v1.Echo/Echo
ERROR:
Code: Unavailable
Message: UNAVAILABLE after 500 milliseconds
```
## Configuration
| Environment variable | Default |
|----------------------|-----------|
| `LOG_LEVEL` | `INFO` |
| `GRPC_SERVER_HOST` | `0.0.0.0` |
| `GRPC_SERVER_PORT` | `4770` |
| `GRPC_CLIENT_HOST` | NA |
| `GRPC_CLIENT_PORT` | NA |