Merge branch 'feature/socket-options' of https://github.com/Upperfoot/nest into Upperfoot-feature/socket-options

This commit is contained in:
Kamil Myśliwiec
2019-04-10 12:57:44 +02:00
7 changed files with 9 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ describe('RabbitMQ transport', () => {
urls: [`amqp://localhost:5672`],
queue: 'test',
queueOptions: { durable: false },
socketOptions: { noDelay: true },
},
});
await app.startAllMicroservicesAsync();

View File

@@ -19,6 +19,7 @@ export class RMQBroadcastController {
urls: [`amqp://localhost:5672`],
queue: 'test_broadcast',
queueOptions: { durable: false },
socketOptions: { noDelay: true },
},
});
}

View File

@@ -22,6 +22,7 @@ export class RMQController {
urls: [`amqp://localhost:5672`],
queue: 'test',
queueOptions: { durable: false },
socketOptions: { noDelay: true },
},
});
}

View File

@@ -89,5 +89,6 @@ export interface RmqOptions {
prefetchCount?: number;
isGlobalPrefetchCount?: boolean;
queueOptions?: any;
socketOptions?: any;
};
}

View File

@@ -92,7 +92,8 @@ export class ClientRMQ extends ClientProxy {
}
public createClient<T = any>(): T {
return rqmPackage.connect(this.urls) as T;
const socketOptions = this.getOptionsProp<RmqOptions>(this.options, 'socketOptions');
return rqmPackage.connect(this.urls, socketOptions) as T;
}
public mergeDisconnectEvent<T = any>(

View File

@@ -93,5 +93,6 @@ export interface RmqOptions {
prefetchCount?: number;
isGlobalPrefetchCount?: boolean;
queueOptions?: any;
socketOptions?: any;
};
}

View File

@@ -75,7 +75,8 @@ export class ServerRMQ extends Server implements CustomTransportStrategy {
}
public createClient<T = any>(): T {
return rqmPackage.connect(this.urls);
const socketOptions = this.getOptionsProp<RmqOptions>(this.options, 'socketOptions');
return rqmPackage.connect(this.urls, socketOptions);
}
public async setupChannel(channel: any, callback: Function) {