maestro connection with microservices - clients and modules

This commit is contained in:
rodrigo.zamboni
2022-03-18 10:16:27 -03:00
parent e15a680b9f
commit 1523c6b4d1
25 changed files with 1668 additions and 639 deletions
+21 -16
View File
@@ -1,17 +1,22 @@
// import { join } from 'path';
// import { ClientOptions, Transport } from '@nestjs/microservices';
import { ClientOptions, Transport } from '@nestjs/microservices';
import { TransformationProtofile } from '@victorradael/protospack';
import { credentials } from '@grpc/grpc-js';
// export const TransformationsClientConfiguration: ClientOptions = {
// transport: Transport.GRPC,
// options: {
// //url: `${process.env.USERS_SVC_URL}:${process.env.USERS_SVC_PORT}`,
// url: `127.0.0.1:50054`,
// package: 'transformation',
// protoPath: join(__dirname, '..', 'proto', 'transformation.proto'),
// loader: {
// enums: String,
// objects: true,
// arrays: true,
// },
// },
// };
export class TransformationsClientConfiguration {
config(): ClientOptions {
return {
transport: Transport.GRPC,
options: {
url: process.env.TRFACTORY_URL,
package: 'transformation',
// credentials: credentials.createSsl(),
protoPath: TransformationProtofile,
loader: {
enums: String,
objects: true,
arrays: true,
},
},
};
}
};