mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
updated the typings for rmq socket options to match the interface provided by connection manager
This commit is contained in:
@@ -9,3 +9,10 @@ export interface RmqUrl {
|
||||
heartbeat?: number;
|
||||
vhost?: string;
|
||||
}
|
||||
|
||||
export interface AmqpConnectionManagerSocketOptions {
|
||||
reconnectTimeInSeconds?: number
|
||||
heartbeatIntervalInSeconds?: number
|
||||
findServers?: () => string | string[]
|
||||
connectionOptions?: any
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { Server } from '../server/server';
|
||||
import { CustomTransportStrategy } from './custom-transport-strategy.interface';
|
||||
import { Deserializer } from './deserializer.interface';
|
||||
import { Serializer } from './serializer.interface';
|
||||
import { RmqUrl } from '../external/rmq-url.interface';
|
||||
import { AmqpConnectionManagerSocketOptions, RmqUrl } from '../external/rmq-url.interface';
|
||||
|
||||
export type MicroserviceOptions =
|
||||
| GrpcOptions
|
||||
@@ -128,7 +128,7 @@ export interface RmqOptions {
|
||||
prefetchCount?: number;
|
||||
isGlobalPrefetchCount?: boolean;
|
||||
queueOptions?: any;
|
||||
socketOptions?: any;
|
||||
socketOptions?: AmqpConnectionManagerSocketOptions;
|
||||
noAck?: boolean;
|
||||
serializer?: Serializer;
|
||||
deserializer?: Deserializer;
|
||||
|
||||
@@ -89,7 +89,7 @@ export class ServerRMQ extends Server implements CustomTransportStrategy {
|
||||
|
||||
public createClient<T = any>(): T {
|
||||
const socketOptions = this.getOptionsProp(this.options, 'socketOptions');
|
||||
const options = Object.assign({}, socketOptions);
|
||||
const options: RmqOptions["options"]["socketOptions"] = Object.assign({}, socketOptions);
|
||||
options.connectionOptions = socketOptions;
|
||||
return rqmPackage.connect(this.urls, options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user