fix(messaging): random crash when tried to close not connected channel
MODIFY
packages/messaging/package.json
packages/messaging/package.json
"@types/amqp-connection-manager": "^2.0.4",
"@types/amqplib": "^0.5.11",
"@types/redis": "^2.8.14",
- "amqp-connection-manager": "^3.0.0",
+ "amqp-connection-manager": "^3.2.0",
"amqplib": "^0.5.3",
"redis": "^2.8.0"
},

MODIFY
packages/messaging/src/transport/strategies/amqp.strategy.ts
packages/messaging/src/transport/strategies/amqp.strategy.ts
@@ -158,7 +158,7 @@ class AmqpStrategy implements TransportLayer {
await import('amqplib');
const amqplib = await import('amqp-connection-manager');
- const connectionManager = await amqplib.connect([host]);
+ const connectionManager = amqplib.connect([host]);
const channelWrapper = connectionManager.createChannel({
json: false,
@@ -178,6 +178,8 @@ class AmqpStrategy implements TransportLayer {
},
});
+ await (channelWrapper as any).waitForConnect(); // not available in @types/amqp-connection-manager
+
return new AmqpStrategyConnection(
msgSubject$,
connectionManager,

MODIFY
yarn.lock
yarn.lock
@@ -1813,10 +1813,10 @@ ajv@^6.9.1:
json-schema-traverse "^0.4.1"
uri-js "^4.2.2"
-amqp-connection-manager@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/amqp-connection-manager/-/amqp-connection-manager-3.0.0.tgz#9e273c616122033ca802f962b4d0e48895a5ff9a"
- integrity sha512-a5MsUDsG+CqMjwk/WNFSTE0H4pAaWJXw7L24QFa3MeaB+KA05PXoBsppYlIzaIqc1XLWZwjO9J42AFHNrDsVFQ==
+amqp-connection-manager@^3.2.0:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/amqp-connection-manager/-/amqp-connection-manager-3.2.0.tgz#83534360533a48183113f8213af0d230c7b8d461"
+ integrity sha512-CnxBqUXd6ft4DbGs8YXNp0hDZgWiDQAghxG6JRJuxGbGEQdAjsb4oRR9PWBqO5V/Gssp7lDKigXX+DtSczID2w==
dependencies:
promise-breaker "^5.0.0"

fix(messaging): random crash when tried to close not connected channel