You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/microservices/grpc.md
+36-36
Original file line number
Diff line number
Diff line change
@@ -377,42 +377,6 @@ Nest supports GRPC stream handlers in two possible ways:
377
377
378
378
<app-banner-enterprise></app-banner-enterprise>
379
379
380
-
#### Health checks
381
-
382
-
When running a gRPC application in an orchestrator such a Kubernetes, you may need to know if it is running and in a healthy state. The [gRPC Health Check specification](https://grpc.io/docs/guides/health-checking/) is a standard that allow gRPC clients to expose their health status to allow the orchestrator to act accordingly.
383
-
384
-
To add gRPC health check support, first install the [grpc-node](https://github.com/grpc/grpc-node/tree/master/packages/grpc-health-check) package:
385
-
386
-
```bash
387
-
$ npm i --save grpc-health-check
388
-
```
389
-
390
-
Then it can be hooked into the gRPC service using the `onLoadPackageDefinition` hook in your gRPC server options, as follows. Note that the `protoPath` needs to have both the health check and the hero package.
> info **Hint** The [gRPC health probe](https://github.com/grpc-ecosystem/grpc-health-probe) is a useful CLI to test gRPC health checks in a containerized environment.
415
-
416
380
#### Streaming sample
417
381
418
382
Let's define a new sample gRPC service called `HelloService`. The `hello.proto` file is structured using <ahref="https://developers.google.com/protocol-buffers">protocol buffers</a>. Here's what it looks like:
Here we used the `callback` function to send the response once processing of the `requestStream` has been completed.
545
509
510
+
#### Health checks
511
+
512
+
When running a gRPC application in an orchestrator such a Kubernetes, you may need to know if it is running and in a healthy state. The [gRPC Health Check specification](https://grpc.io/docs/guides/health-checking/) is a standard that allow gRPC clients to expose their health status to allow the orchestrator to act accordingly.
513
+
514
+
To add gRPC health check support, first install the [grpc-node](https://github.com/grpc/grpc-node/tree/master/packages/grpc-health-check) package:
515
+
516
+
```bash
517
+
$ npm i --save grpc-health-check
518
+
```
519
+
520
+
Then it can be hooked into the gRPC service using the `onLoadPackageDefinition` hook in your gRPC server options, as follows. Note that the `protoPath` needs to have both the health check and the hero package.
> info **Hint** The [gRPC health probe](https://github.com/grpc-ecosystem/grpc-health-probe) is a useful CLI to test gRPC health checks in a containerized environment.
545
+
546
546
#### gRPC Metadata
547
547
548
548
Metadata is information about a particular RPC call in the form of a list of key-value pairs, where the keys are strings and the values are typically strings but can be binary data. Metadata is opaque to gRPC itself - it lets the client provide information associated with the call to the server and vice versa. Metadata may include authentication tokens, request identifiers and tags for monitoring purposes, and data information such as the number of records in a data set.
0 commit comments