I have a system that will generate messages sporadically, and I would like to send only zero or one message every 5 minutes. If a message is not generated, nothing will be processed by the queue consumer. If within 5 minutes a hundred identical messages are generated, I want one of them to be used up from the queue.
I am using AMQP (RabbitMQ), is there a way to do this using rabbitmq or the AMQP protocol? Can I check the contents of the queue to make sure that I am not inserting a duplicate? Queuing seems to be a bad idea, and usually this should not be done for the messaging system.
Without checking the queue, can this be done using these tools? The only solution that comes to mind is the second line, which receives all messages, then the consumer reads each message and puts it in the internal queue, waits 5 minutes, and any repeated messages are discarded. After the delay, one message is placed in the "real" queue to be processed.
It looks like this might be a normal situation that the queue system can handle. Any ideas?
process duplicate-removal delay message-queue amqp
Kekoa
source share