Commit Graph

82 Commits

Author SHA1 Message Date
Kamil Myśliwiec
10fdf16c47 build: use strict null checks part 1 2024-11-26 12:46:59 +01:00
Kamil Myśliwiec
8829b8d1d7 style: address packages lint errors 2024-11-26 10:38:31 +01:00
Kamil Myśliwiec
3dfc7fc68e feat(microservices): add status, unwrap, on, and other features 2024-11-15 10:03:05 +01:00
yurks
eef433424d style(microservices): improve code readability 2024-01-02 18:39:53 +02:00
yurks
da3856e7e2 fix(microservices): grpc client closing 2023-12-22 16:08:24 +02: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
tanhovan
9f3d1c9c76 fix(microservices): support client cancel grpc request in unary stream - fix pull-request 2023-07-14 15:26:06 +07:00
tanhovan
400749d083 fix(microservices): support client cancel grpc request in unary stream 2023-07-14 08:58:52 +07:00
Tony133
0df4dcafa2 chore(microservices): mark facing apis public in microservices 2023-02-09 10:33:27 +01: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
68e6d44fcd Merge branch 'master' of github.com:PhilipMantrov/nest into PhilipMantrov-master 2022-09-19 14:59:40 +02:00
szilveszterandras
269ffa3d62 fix(microservices): cleanup unary call on unsubscribe 2022-09-16 19:21:38 +03:00
Philip Mantrov
6538324c0d feat(microservices): path, package and service names added to exceptions 2022-09-02 18:43:52 +03:00
gil
1cebb6dbb5 fix(microservice): grpc-client serialize error
closes #10104
2022-08-14 00:05:37 +03:00
Tom Chauveau
23170cf1c8 fix(microservices): generate service method in lower and uppercase
RPC methods in protobuf are commonly declare in PascalCase, but they were generated lowercase
by ClientGrpcProxy.getService method.
Protobuf and gRPC have tools to generate interface and message in Typescript directly from
protobuf. It's a powerful feature that's helping to maintain only one source of truth.
But with that lowercase method generation, developers were forced to define their own interface
which can be painful to maintain.
This commit fix that issue by generating methods both in lowercase and in uppercase.

Solves #9047

Signed-off-by: Vasek - Tom C <tom.chauveau@epitech.eu>
2022-01-29 01:15:49 +01:00
zmj
3d9539268c feat(microservices): support ncc when using grpc 2021-11-17 16:16:41 +08:00
Kamil Mysliwiec
4bf2fd4747 Merge pull request #8365 from sjkummer/fix-grpc-channel-options
Fix grpc channel options
2021-11-08 09:28:16 +01:00
Aaron Schweig
76f2918f17 feat(microservices): adds packageDefinition option to ClientGrpc
Closes #8457
2021-10-28 17:44:24 +02: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
Nazarii Romankiv
81e1e21289 refactor(microservices): applied comment suggestion 2021-10-12 23:09:17 +03:00
Nazarii Romankiv
0bd2365711 fix(microservices): use root package when packageName is not defined 2021-10-07 09:59:27 +03:00
Kamil Myśliwiec
9d0551ff25 style(): run prettier 2021-08-16 09:30:29 +02:00
ssilve1989
6d6b139250 fix(microservices): cleanup upstream subscription in client-side gRPC stream calls 2021-08-03 08:43:42 -06:00
Kamil Myśliwiec
470fcf8695 chore(): resolve merge conflicts 2021-02-04 15:09:09 +01:00
Kamil Myśliwiec
0ba2658ab4 fix(microservices): auto close clients on app shutdown 2021-02-03 10:20:24 +01:00
Gustavo Perdomo
a66a1836b8 feat: move from grpc to @grpc/grpc-js
build: update package dependencies

fix: use bindAsync in server-grpc

test(): server gprc port already listen error

test(): remove surplus commit

feat: fix packages

# Conflicts:
#	package-lock.json
#	package.json
#	sample/04-grpc/package-lock.json
#	sample/04-grpc/package.json
2020-07-02 11:22:53 -04:00
Kamil Myśliwiec
f315ca2b90 fix(): remove duplicated options, apply formatting rules 2020-05-24 13:54:25 +02:00
Kamil Myśliwiec
b397cec0fd Merge branch 'bugfix/grpc-options' of https://github.com/sjkummer/nest into sjkummer-bugfix/grpc-options 2020-05-24 13:51:51 +02:00
Jacky Wijaya
d562bc0225 fix(microservices): enable grpc option value to accept 0 2020-05-17 22:06:57 +07:00
Sebastian Schmid
b0dc39e589 introduced GRPC channelOptions 2020-04-16 19:44:47 +02:00
Sebastian Schmid
653cc9a787 Merge branch 'master' into bugfix/grpc-options
# Conflicts:
#	packages/microservices/client/client-grpc.ts
2020-04-16 19:35:57 +02:00
Kamil Myśliwiec
9a694cb853 fix(grpc): fix credentials options 2020-04-16 10:00:53 +02:00
Sebastian Schmid
09ab0087af GRPC: Fix credentials and introduce arguments 2020-04-15 23:56:56 +02:00
danielscw
0b38029830 fix(microservices): fix get service from multi package grpc client error
Calling getService of grpc clients with multiple packages shows error
'Channel third argument (options) must be an object with string keys
and integer or string values'. Which is caused by passing options with
GrpcOptions['options'] format to grpc client's constructor.
As the options are transformed and kept in 'maxMessageLengthOptions' and
'keepaliveOptions', we can remove and skip passing ClientGrpcProxy's
options to node grpc Client's constructor.
2020-03-29 15:43:32 +08:00
Nico Francois
4b3d476571 feat(microservices): implement server grpc max metadata size option 2020-03-24 16:35:32 +01:00
Kamil Myśliwiec
d3e14195e2 fix(): resolve merge conflicts 2020-03-11 22:41:53 +01:00
Kamil Myśliwiec
ee55ceb175 fix(microservices): fix sending metadata with grpc streaming 2020-03-03 12:23:34 +01:00
Kamil Myśliwiec
e8da23cd12 refactor(): minor style improvements 2020-03-03 09:13:25 +01:00
Kamil Myśliwiec
28bf111cc1 refactor(): add get keepalive options object method 2020-03-02 17:38:50 +01:00
CatsMiaow
51a968c779 feat(microservices): keepalive option in grpc clinet
https://github.com/grpc/grpc/blob/master/doc/keepalive.md
2020-02-24 14:27:24 +09:00
Kamil Myśliwiec
f7d089fc95 fix(microservices): fix unit tests, add tests for request stream 2020-01-29 23:15:21 +01:00
Kamil Myśliwiec
70c41e2d00 feat(microservices): support passing upstream subject to grpc client 2020-01-29 17:34:38 +01:00
Kamil Myśliwiec
c5d1122f0d refactor(microservices): align to the rest of codebase 2020-01-24 14:32:13 +01:00
Alex Dukhnovskiy
61459cbce9 fix(microcervices): fix multipackages client 2019-10-31 20:52:34 +03:00
Alex Dukhnovskiy
cf2c1ae626 fix(microservices): fix tests and CS grpc-multipackage 2019-10-04 10:26:44 +03:00
Alex Dukhnovskiy
8ff5d1df8b Merge branch 'master' into feature/grpc-multipackage
# Conflicts:
#	integration/microservices/src/grpc/grpc.controller.ts
#	packages/microservices/client/client-grpc.ts
#	packages/microservices/server/server-grpc.ts
2019-10-04 01:06:32 +03:00
Alex Dukhnovskiy
9e2d606382 feat(microservices): add multiple grpc packages and proto files to config
before:

grpcOptions: <GrpcOptions>{
    transport: Transport.GRPC,
    options: {
        url: 'url',
        package: 'name.package',
        protoPath: 'alone.proto'
    }
}
after:

grpcOptions: <GrpcOptions>{
    transport: Transport.GRPC,
    options: {
        url: 'url',
        package: ['name.package', 'other.package'],
        protoPath: [
        'one.proto',
        'two.proto',
        'any.proto'
        ]
    }
}
2019-10-03 20:22:19 +03:00
Alex Dukhnovskiy
fc7b44c474 feature(microservices): add multiple proto to grpc config
before:
grpcOptions: <GrpcOptions>{
    transport: Transport.GRPC,
    options: {
        url: 'url',
        package: 'name.package',
        protoPath: 'alone.proto'
    }
}
after:
grpcOptions: <GrpcOptions>{
    transport: Transport.GRPC,
    options: {
        url: 'url',
        package: ['name.package', 'other.package'],
        protoPath: [
        'one.proto',
        'two.proto',
        'any.proto'
        ]
    }
}
2019-10-02 16:29:29 +03:00
Kamil Myśliwiec
733560d873 refactor(microservices) use delete instead of object destructing 2019-09-10 14:22:42 +02:00