I installed RabbitMQ with the message deduplication plugin on my localhost and deduplication worked out of the box without me having to explicitly specify an exchange.
The moment I opted for CloudAMQP and installed the Message Deduplication plugin, deduplication stopped working. Is there something else I need to do for message deduplication to work in production under CloudAMQP.
Below is the NodeJS code I used that worked perfectly in localhost but not working in production:
.....
channel.assertQueue('test_queue', {
durable: true,
arguments: {
'x-message-deduplication': true,
}
}),
channel.prefetch(1),
channel.consume('test_queue',
handleIncomingMessage)
......
handleIncomingMessage(message){
channel.ack(message);
}
Then when sending messages to the queue I used the following:
channel?.sendToQueue('test_queue', { ...data }, {
headers: {
'x-deduplication-header': `${data.id}`,
}
})
The above code worked perfectly in my local rabbitmq instance with no duplicate messages but not working in CloudAMQP. Duplicate messages are happening in cloudamqp. Really weird.
What else do I need to do please?