mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
move to create_container on rhea
This commit is contained in:
parent
ca8aed39dd
commit
a4d45e4eda
|
@ -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 { IExecuteFunctions } from 'n8n-core';
|
||||||
import {
|
import {
|
||||||
|
@ -114,7 +115,7 @@ export class Amqp implements INodeType {
|
||||||
throw new Error('Queue or Topic required!');
|
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
|
Values are documentet here: https://github.com/amqp/rhea#container
|
||||||
|
|
|
@ -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 { ITriggerFunctions } from 'n8n-core';
|
||||||
import {
|
import {
|
||||||
|
@ -163,8 +164,7 @@ export class AmqpTrigger implements INodeType {
|
||||||
durable = true;
|
durable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const container: Container = require('rhea');
|
const container = rhea.create_container();
|
||||||
|
|
||||||
|
|
||||||
let lastMsgId: string| number | Buffer | undefined = undefined;
|
let lastMsgId: string| number | Buffer | undefined = undefined;
|
||||||
const self = this;
|
const self = this;
|
||||||
|
@ -179,7 +179,6 @@ export class AmqpTrigger implements INodeType {
|
||||||
if(!context.message)
|
if(!context.message)
|
||||||
return;
|
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
|
// 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) {
|
if (context.message.message_id && context.message.message_id === lastMsgId) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue