Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
call(@Body() options): Observable {
const client = ClientProxyFactory.create(options);
return client
.send({ cmd: 'none' }, [1, 2, 3])
.pipe(
/*tap(
console.log.bind(console, 'data'),
console.error.bind(console, 'error'),
),*/
catchError(error => {
const { code } = error || { code: 'CONN_ERR' };
return throwError(
code === 'ECONNREFUSED' || code === 'CONN_ERR'
? new RequestTimeoutException('ECONNREFUSED')
: new InternalServerErrorException(),
);
}),
);
useFactory: (config: ConfigService): ClientProxy => {
const messagingUrl = config.getMessagingConfig().messagingUrl;
return ClientProxyFactory.create({
options: {
servers: typeof messagingUrl === "string" ? [messagingUrl] : messagingUrl,
},
transport: Transport.NATS,
});
},
};
constructor() {
this.client = ClientProxyFactory.create({
transport: Transport.RMQ,
options: {
urls: [`amqp://localhost:5672`],
queue: 'test',
queueOptions: { durable: false },
socketOptions: { noDelay: true },
},
});
}
constructor() {
this.client = ClientProxyFactory.create({
transport: Transport.RMQ,
options: {
urls: [`amqp://localhost:5672`],
queue: 'test_broadcast',
queueOptions: { durable: false },
socketOptions: { noDelay: true },
},
});
}