diff --git a/packages/nodes-base/nodes/Amqp/Amqp.node.ts b/packages/nodes-base/nodes/Amqp/Amqp.node.ts index 653d0dff92..ab7f2e21b8 100644 --- a/packages/nodes-base/nodes/Amqp/Amqp.node.ts +++ b/packages/nodes-base/nodes/Amqp/Amqp.node.ts @@ -1,4 +1,5 @@ -import { ContainerOptions, Delivery, Dictionary, EventContext } from 'rhea'; +import { ContainerOptions, Dictionary, EventContext } from 'rhea'; +import rhea = require('rhea'); import { IExecuteFunctions } from 'n8n-core'; import { @@ -114,7 +115,7 @@ export class Amqp implements INodeType { throw new Error('Queue or Topic required!'); } - const container = require('rhea'); + const container = rhea.create_container(); /* Values are documentet here: https://github.com/amqp/rhea#container diff --git a/packages/nodes-base/nodes/Amqp/AmqpTrigger.node.ts b/packages/nodes-base/nodes/Amqp/AmqpTrigger.node.ts index 9a5d9f204e..3b3bf8a553 100644 --- a/packages/nodes-base/nodes/Amqp/AmqpTrigger.node.ts +++ b/packages/nodes-base/nodes/Amqp/AmqpTrigger.node.ts @@ -1,4 +1,5 @@ -import { Container, ContainerOptions, EventContext, Message, ReceiverOptions } from 'rhea'; +import { ContainerOptions, EventContext, Message, ReceiverOptions } from 'rhea'; +import rhea = require("rhea"); import { ITriggerFunctions } from 'n8n-core'; import { @@ -163,8 +164,7 @@ export class AmqpTrigger implements INodeType { durable = true; } - const container: Container = require('rhea'); - + const container = rhea.create_container(); let lastMsgId: string| number | Buffer | undefined = undefined; const self = this; @@ -179,7 +179,6 @@ export class AmqpTrigger implements INodeType { if(!context.message) return; - console.log("New Message on Amqp Trigger from " + container.id + " context conteaineer id: " + context.container.id); // ignore duplicate message check, don't think it's necessary, but it was in the rhea-lib example code if (context.message.message_id && context.message.message_id === lastMsgId) { return;