Commit Graph

107 Commits

Author SHA1 Message Date
Kamil Myśliwiec
236b633a76 style: address integration tests lint errors 2024-11-26 09:39:20 +01:00
Kamil Myśliwiec
3267135f2d chore: resolve merge conflicts 2024-11-18 12:45:34 +01:00
Kamil Mysliwiec
a669981c81 Merge pull request #14121 from nestjs/feat/logger-additions
feat(common): json logger and a few other improvements
2024-11-18 10:09:57 +01:00
Kamil Myśliwiec
f37dafc132 chore: pass error instance to logger error method 2024-11-18 09:08:47 +01:00
Kamil Myśliwiec
3dfc7fc68e feat(microservices): add status, unwrap, on, and other features 2024-11-15 10:03:05 +01:00
Kamil Mysliwiec
5cdea22c39 Merge pull request #13468 from nestjs/revert-13467-revert-13283-fix/unnecessary-call
fix(microservices): delete unnecessary call of grpcClient.start
2024-11-06 12:54:35 +01:00
JadenKim-dev
27d01d6ed2 feat: added optional chaining 2024-06-30 22:49:37 +09:00
JadenKim-dev
ce0b4fbd88 feat: grpc package name can be specified with service name 2024-06-30 22:31:11 +09:00
Kamil Mysliwiec
75fa678e8d Merge pull request #13368 from ssilve1989/refactor/cleanup-grpc-call-handling
refactor(microservices): prevent grpc write promise from throwing
2024-06-03 13:04:40 +02:00
Kamil Mysliwiec
24755d6d26 Merge pull request #13392 from yjiq150/grpc-refactor
refactor(microservices): improve speed of grpc server initialization
2024-06-03 13:04:23 +02:00
Tony133
151806b621 chore: add public api annotation on microservices 2024-05-05 15:18:04 +02:00
Kamil Mysliwiec
7d5adfcc1f Revert "Revert "fix(microservice) Delete unnecessary call of grpcClient.start"" 2024-04-19 09:14:09 +02:00
Kamil Mysliwiec
044603ab7b Revert "fix(microservice) Delete unnecessary call of grpcClient.start" 2024-04-19 09:13:10 +02:00
yjiq150
9dec08e930 refactor(microservices): improve speed of grpc server initialization 2024-04-03 22:47:24 +09:00
Steven Silvestri
22a9245a1a refactor(microservices): prevent grpc write promise from throwing 2024-03-28 02:08:28 -06:00
Kamil Mysliwiec
f416f5af79 Revert "fix(microservices): fix redundant code to emit error" 2024-03-27 08:34:38 +01:00
Kamil Mysliwiec
d5e2879b45 Merge pull request #12899 from jtimmons/feat/grpc-reflection
feat(microservices): add support for grpc reflection api
2024-03-18 10:16:57 +01:00
Kamil Mysliwiec
dad9ba3bc9 Merge pull request #13283 from youngkiu/fix/unnecessary-call
fix(microservice) Delete unnecessary call of grpcClient.start
2024-03-17 19:18:52 +01:00
YoungKi Lyu
44bd97e6cf fix(microservices): fix redundant emit error code 2024-03-16 17:22:19 +09:00
Justin Timmons
f0baed7370 feat(microservices): add grpc pkg-load hook to support server extensions 2024-02-29 22:37:08 -05:00
YoungKi Lyu
4eff063c00 Delete unnecessary call of grpc 2024-03-01 12:35:48 +09:00
Justin Timmons
e1ba288590 Revert "feat(microservices): add support for grpc reflection api"
This reverts commit d513667b9a61bf40c37dd08891571c3930920302.
2024-02-29 22:34:53 -05:00
Justin Timmons
d2ce8566ce feat(microservices): add support for grpc reflection api 2024-02-29 22:34:26 -05:00
apeltop
5954841c8d chore(common, core, microservices): Change mismatched JSDoc 2024-02-29 10:40:51 +09:00
Nikolay Alexandrov
4cdd3f4dd2 fix(microservices): emit an error to grpc stream before unsubscribe 2024-02-10 01:22:07 +03:00
Kamil Myśliwiec
8d08184a34 refactor(microservices): a few minor tweaks 2023-12-18 09:12:46 +01:00
Kamil Myśliwiec
0a6853c847 Merge branch 'feature/grpc-server-package-definition' of https://github.com/krugi/nest into krugi-feature/grpc-server-package-definition 2023-12-18 09:08:02 +01:00
Ben Lesh
2e8f5cebf7 fix(microservices): fix backpressure with integration test
Resolves an issue where the code assumed the first value written to the stream
where `write` returned `false` was not written, when in fact it is.

Adds integration test to verify the fix.

Updates unit tests to have the proper behavior in the mock.

NOTE: This fix has been independently verified in our business environment.

NOTEx2: This is totally my (@benlesh) fault. :/

fixes #12768
2023-11-17 11:50:23 -06:00
Kamil Mysliwiec
a3f3b97a19 Merge pull request #12673 from Hellomik2002/catch-stream-error-grpc
FIX catch stream errors in grpc
2023-11-17 13:12:49 +01:00
Ben Lesh
11ded4dd9a fix(grpc): ensure all buffered values drain
+ Ensures all values that are buffered while the stream is unwritable are written when the drain event fires.
+ Ensures that if the stream becomes unwritable while draining, it will wait for another drain event.
+ Ensures that if the observable completes while draining, it will wait for the entire buffer to be drained before resolving.
+ Ensures that if the observable errors while draining, it will wait for the entire buffer to be drained before rejecting.
+ Fixes tests that had some incorrect assumptions around stream write returns and the order of events.
+ Adds a more comprehensive set of tests for writing the observable to the stream.

Fixes #12751
2023-11-15 12:46:55 -06:00
Hellomik2002
8dfba64f05 FIX catch stream errors
At the current moment if you throw error in stream, It will throw all app, but with this fix error will be handled, and server will not fall dawn
2023-10-30 07:26:44 +06:00
Ben Lesh
7184b7b1ad fix(grpc): will properly write to streams
fixes #12330
2023-08-31 15:05:24 -05:00
Kamil Myśliwiec
de2adcff9d refactor: cleanup imports, move write fn to class body 2023-08-30 14:50:53 +02:00
Ben Lesh
6c9321793c fix: appropriately handle backpressure
Adds code to handle back pressure when writing output from Observable streams.
2023-08-28 18:06:59 -05:00
Kamil Myśliwiec
8857e7e950 style: apply formatting (prettier) 2023-08-28 10:47:53 +02:00
Tran Quang
1315babe48 fix(microservices): handle error thrown in the stream gRPC controller
Assert responseCallback called once
2023-08-25 17:06:26 +07:00
Mathieu Bergeron
93824ab4ed feat(microservices): allow grpc-server graceful shutdown 2023-07-12 09:01:09 -04:00
Julien Sarazin
9af95fcf50 fix(microservices): grpc-server handle async interceptors 2023-04-06 16:06:34 +02:00
krugi
7de2ff29a5 feat(microservices): add package definition option to server-grpc
PR #8465 added support for packageDefinition for ClientGrpc, this commit adds it to ServerGrpc.
Exported common packageDefinition logic to getGrpcPackageDefinition and used it in both gRPC Server & Client, for consistency.
This change means that protoPath is now optional - getGrpcPackageDefinition verifies that either protoPath or PackageDefinition exist.
Also, fixed the error thrown from ServerGrpc.loadProto: was Error, now InvalidProtoDefinitionException, as it is in ClientGrpc
2022-11-07 16:15:34 +02:00
Kamil Myśliwiec
a0767491a1 style(microservices): wrap error message params in quotation marks 2022-09-19 15:00:53 +02:00
Philip Mantrov
6538324c0d feat(microservices): path, package and service names added to exceptions 2022-09-02 18:43:52 +03:00
Micael Levi (lab)
fd720e899d refactor: remove deprecated apis from 3rd-party deps
Replacie old and deprecated APIs from `rxjs`, `body-parser`
and NodeJS core (read this guide https://nodejs.org/en/docs/guides/buffer-constructor-deprecation).
Do notice that the later only touches test files, thus doesn't affect
production code.
2021-12-24 20:30:33 -04:00
Micael Levi (lab)
82adb3c101 refactor(common,core): use shared utils from common whenever possible
Use every util defined at `shared.utils.ts` from `@nestjs/common`, when
possible. Only spec files aren't touched.
2021-12-16 02:54:06 -04:00
zmj
3d9539268c feat(microservices): support ncc when using grpc 2021-11-17 16:16:41 +08:00
Sebastian Schmid
fdf11a51ae fix(microservices): npm run format 2021-10-27 13:57:15 +02:00
Sebastian Schmid
25dbb330cd Alligned gRPC ChannelOptions code in server and client.
Removed GRPC_DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH and GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH constants. This default values are already the same in the underlying gRPC library. If the gRPC team decides to change that values in the future, nestjs should adopt the new values automatically.
2021-10-19 10:10:45 +02:00
Sebastian Schmid
5ac3637dee The GrpcOptions attribute "channelOptions" was not used anymore (never read in the code). Therefore, declaring those ChannelOptions had no effect anymore and there was no way to configure specific gRPC settings & limits.
Also extended ChannelOptions with grpc-node.max_session_memory which is required when sending big messages (see https://github.com/grpc/grpc-node/pull/1666).

Ensured backward compatibility by including size limits like grpc.max_send_message_length to the ChannelOptions
2021-10-18 23:37:33 +02:00
Kamil Myśliwiec
9d0551ff25 style(): run prettier 2021-08-16 09:30:29 +02:00
Kamil Myśliwiec
18f66e8299 fix(): fix rxjs breaking changes 2021-05-17 14:04:31 +02:00
Kamil Myśliwiec
b711019660 feat(microservices): support multiple event subscribers 2021-02-05 15:15:32 +01:00