Skip to content

Commit

Permalink
fix(AMQP Trigger Node): Properly close connection after manual test s…
Browse files Browse the repository at this point in the history
…tep (n8n-io#8396)
  • Loading branch information
michael-radency authored Jan 19, 2024
1 parent daba5bb commit 2c14371
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/nodes-base/nodes/Amqp/AmqpTrigger.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,18 @@ export class AmqpTrigger implements INodeType {
name: 'clientname',
type: 'string',
default: '',
placeholder: 'for durable/persistent topic subscriptions, example: "n8n"',
placeholder: 'e.g. n8n',
description: 'Leave empty for non-durable topic subscriptions or queues',
hint: 'for durable/persistent topic subscriptions',
},
{
displayName: 'Subscription',
name: 'subscription',
type: 'string',
default: '',
placeholder: 'for durable/persistent topic subscriptions, example: "order-worker"',
placeholder: 'e.g. order-worker',
description: 'Leave empty for non-durable topic subscriptions or queues',
hint: 'for durable/persistent topic subscriptions',
},
{
displayName: 'Options',
Expand Down Expand Up @@ -270,6 +272,10 @@ export class AmqpTrigger implements INodeType {
const manualTriggerFunction = async () => {
await new Promise((resolve, reject) => {
const timeoutHandler = setTimeout(() => {
container.removeAllListeners('receiver_open');
container.removeAllListeners('message');
connection.close();

reject(
new Error(
'Aborted, no message received within 30secs. This 30sec timeout is only set for "manually triggered execution". Active Workflows will listen indefinitely.',
Expand Down

0 comments on commit 2c14371

Please sign in to comment.