updated the typings for rmq socket options to match the interface provided by connection manager

This commit is contained in:
Christian Allred
2020-11-25 14:51:08 -07:00
parent 998d3de9e6
commit fc5b440da2
3 changed files with 10 additions and 3 deletions

View File

@@ -9,3 +9,10 @@ export interface RmqUrl {
heartbeat?: number;
vhost?: string;
}
export interface AmqpConnectionManagerSocketOptions {
reconnectTimeInSeconds?: number
heartbeatIntervalInSeconds?: number
findServers?: () => string | string[]
connectionOptions?: any
}

View File

@@ -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;

View File

@@ -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);
}