stwo
April 3, 2021, 6:50am
1
I’m trying to create a delayed message with RabbitMQ Delayed Message Plugin. But I see that the Header parameter is missing in the RabbitMq node implementation.
let message: string;
const exchangePromises = [];
for (let i = 0; i < items.length; i++) {
if (sendInputData === true) {
message = JSON.stringify(items[i].json);
} else {
message = this.getNodeParameter('message', i) as string;
}
exchangePromises.push(channel.publish(exchange, routingKey, Buffer.from(message)));
}
// @ts-ignore
const promisesResponses = await Promise.allSettled(exchangePromises);
promisesResponses.forEach((response: IDataObject) => {
if (response!.status !== 'fulfilled') {
if (this.continueOnFail() !== true) {
throw new Error(response!.reason as string);
Please expose the header parameter to fix this.
Usage Example
pubChannel.publish(exchange, routingKey, content, {headers: {"x-delay": delay}});
stwo
April 3, 2021, 8:10am
2
2 Likes
Ahh, thanks for the contribution. Really nice. We will be reviewing the PR as soon as we can.
jan
April 4, 2021, 8:36am
4
Thanks a lot. Got reviewed and merged. Will be released with the next version.
1 Like
jan
April 10, 2021, 9:05am
5
Got released with [email protected]