mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(RabbitMQ Trigger Node): Add exchange and routing key options (#7547)
RabbitMQ trigger needs binding for some cases. For example, I need to consume some domain events in my application and they are published with routing key. --------- Co-authored-by: teomane <emre.teoman@bordatech.com>
This commit is contained in:
@@ -76,6 +76,19 @@ export async function rabbitmqConnectQueue(
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
await channel.assertQueue(queue, options);
|
||||
|
||||
if (options.binding && ((options.binding as IDataObject).bindings! as IDataObject[]).length) {
|
||||
((options.binding as IDataObject).bindings as IDataObject[]).forEach(
|
||||
async (binding: IDataObject) => {
|
||||
await channel.bindQueue(
|
||||
queue,
|
||||
binding.exchange as string,
|
||||
binding.routingKey as string,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
resolve(channel);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
|
||||
Reference in New Issue
Block a user