diff --git a/src/Bus/Brokers/RabbitMQBus.ts b/src/Bus/Brokers/RabbitMQBus.ts index a7909ca3..efc83818 100644 --- a/src/Bus/Brokers/RabbitMQBus.ts +++ b/src/Bus/Brokers/RabbitMQBus.ts @@ -228,13 +228,19 @@ export class RabbitMQBus implements Bus { // eslint-disable-next-line max-depth if (response) { - this.channel.sendToQueue( + const sendResult: boolean = this.channel.sendToQueue( replyTo, Buffer.from(JSON.stringify(response)), { correlationId } ); + + // eslint-disable-next-line max-depth + if (!sendResult) { + console.log(sendResult); + await new Promise((resolve) => this.channel.once('drain', resolve)); + } } } } catch (err) { diff --git a/src/index.ts b/src/index.ts index 0ba5bfde..cad07a1c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,4 @@ +process.env.UV_THREADPOOL_SIZE = String(1024); import 'reflect-metadata'; import { GenerateArchive,