mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
Merge branch 'feature/socket-options' of https://github.com/Upperfoot/nest into Upperfoot-feature/socket-options
This commit is contained in:
@@ -23,6 +23,7 @@ describe('RabbitMQ transport', () => {
|
|||||||
urls: [`amqp://localhost:5672`],
|
urls: [`amqp://localhost:5672`],
|
||||||
queue: 'test',
|
queue: 'test',
|
||||||
queueOptions: { durable: false },
|
queueOptions: { durable: false },
|
||||||
|
socketOptions: { noDelay: true },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
await app.startAllMicroservicesAsync();
|
await app.startAllMicroservicesAsync();
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export class RMQBroadcastController {
|
|||||||
urls: [`amqp://localhost:5672`],
|
urls: [`amqp://localhost:5672`],
|
||||||
queue: 'test_broadcast',
|
queue: 'test_broadcast',
|
||||||
queueOptions: { durable: false },
|
queueOptions: { durable: false },
|
||||||
|
socketOptions: { noDelay: true },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export class RMQController {
|
|||||||
urls: [`amqp://localhost:5672`],
|
urls: [`amqp://localhost:5672`],
|
||||||
queue: 'test',
|
queue: 'test',
|
||||||
queueOptions: { durable: false },
|
queueOptions: { durable: false },
|
||||||
|
socketOptions: { noDelay: true },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,5 +89,6 @@ export interface RmqOptions {
|
|||||||
prefetchCount?: number;
|
prefetchCount?: number;
|
||||||
isGlobalPrefetchCount?: boolean;
|
isGlobalPrefetchCount?: boolean;
|
||||||
queueOptions?: any;
|
queueOptions?: any;
|
||||||
|
socketOptions?: any;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ export class ClientRMQ extends ClientProxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public createClient<T = any>(): T {
|
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>(
|
public mergeDisconnectEvent<T = any>(
|
||||||
|
|||||||
@@ -93,5 +93,6 @@ export interface RmqOptions {
|
|||||||
prefetchCount?: number;
|
prefetchCount?: number;
|
||||||
isGlobalPrefetchCount?: boolean;
|
isGlobalPrefetchCount?: boolean;
|
||||||
queueOptions?: any;
|
queueOptions?: any;
|
||||||
|
socketOptions?: any;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,8 @@ export class ServerRMQ extends Server implements CustomTransportStrategy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public createClient<T = any>(): T {
|
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) {
|
public async setupChannel(channel: any, callback: Function) {
|
||||||
|
|||||||
Reference in New Issue
Block a user