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
Kamil Myśliwiec
73c1cf34c1
feat(microservices) add getClientByServiceName to client grpc
2019-09-10 14:20:35 +02:00
TychoTa
44126e9636
bugfix(microservices) remove credentials from options to fix TypeError
...
I use to have the following exception:
```
(node:19) UnhandledPromiseRejectionWarning: TypeError: Channel options must be an object with string keys and integer or string values
```
I was passing down a credential object to the options like this:
```
const credentials = grpc.credentials.createSsl(
readFileSync('/srv/certs/rootCA.pem'),
readFileSync('/srv/certs/server.key'),
readFileSync('/srv/certs/server.crt')
);
// later
@Client({
transport: Transport.GRPC,
options: {
url: 'ms-proxy:50051',
package: 'hero',
protoPath: join(__dirname, '..', 'proto/hero.proto'),
credentials,
},
})
``
2019-06-22 17:18:53 +02:00
Kamil Myśliwiec
d88b920dba
refactor(microservices): move client options for every client
2019-05-30 15:36:34 +02:00
Kamil Myśliwiec
275a97a84d
feat(grpc): add more options to grpcClient (max message length)
2019-05-30 14:53:19 +02:00
Kamil Myśliwiec
e4179eb380
enhancement() add loader function to load package utility
2019-01-30 23:07:34 +01:00
Kamil Myśliwiec
4f767080bf
feature() add external context, microservices event patterns
2019-01-04 16:59:11 +01:00
Kamil Myśliwiec
4796023e02
chore() resolve conflicts
2018-12-10 22:03:06 +01:00
Kamil Myśliwiec
1cac0a99fd
feature: more typings, refactor
2018-11-28 23:08:27 +01:00
Kamil Myśliwiec
0b23422ab1
refactor: reduce implicit types
2018-11-24 17:28:28 +01:00
Kamil Myśliwiec
1cb3ed7f87
refactor: general refactor reorganize, rename things
2018-11-24 16:01:29 +01:00
Aleksey Tsvetkov
4b55261aeb
feat(client-grpc): added protoLoader option for grpc client
2018-11-08 11:32:32 +03:00
Kamil Myśliwiec
4b6ca2a3e0
bugfix(microservices) fix client with loader settings
2018-09-13 10:41:28 +02:00
Kamil Myśliwiec
d048f23ff8
improvement(microservices) ensure that connection is shared across promises
2018-09-05 09:37:09 +02:00
Kamil Myśliwiec
b6fe9b06cc
refactor(microservices) remove unecessary options object
2018-09-02 22:31:11 +02:00