move to create_container on rhea

This commit is contained in:
Günther Erb 2020-12-30 15:26:00 +01:00
parent ca8aed39dd
commit a4d45e4eda
2 changed files with 6 additions and 6 deletions

View file

@ -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

View file

@ -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;