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}});