I want my pub/sub to store only the last available message on the channel, and dump all prior ones that wouldn't have been consumed because of the consumer being too slow (or paused). ZMQ has the CONFLATE option, but does RabbitMQ have a similar option on Python (pika)?
The publisher updates at 50Hz, while some subscribers cannot process quite that fast (between 10 to 50Hz). I don't want them to process the oldest message in queue (which means processing data that is already outdated); it must process only the last available message when it's ready to consume.
RabbitMQ actually does support the scenario as-described out of the box, via the Maximum Queue Length feature.
From the documentation:
The maximum length of a queue can be limited to a set number of messages... In all cases the number of ready messages is used; unacknowledged messages do not count towards the limit.
The default behaviour for RabbitMQ when a maximum queue length or size is set and the maximum is reached is to drop or dead-letter messages from the front of the queue (i.e. the oldest messages in the queue).