0
votes

I use both AMQP and MQTT protocols in RabbitMQ. I use the pica library for AMQP and the paho library for MQTT. I can give a message limit when I define the tail with Pika (x-max-length). But when I use paho for MQTT, I cannot limit the message. If I give the queue 50 message limit in the AMQP, the number of messages in the queue will never exceed 50. Why can't I do this on MQTT, is there another way I can set a message limit?

https://www.youtube.com/watch?v=xcpxGJuOyBQ

There is a sample video. The broadcaster sends the message fast, but because the receiver is slow, too many messages accumulate in the broker. I always want to receive the last message.

1
Why don't you add what you've tried? It's difficult to debug an issue without even knowing your approaches?Redowan Delowar
Because MQTT topics are not queueshardillb
@RedowanDelowar I want to use it because the rate of consumers who receive messages is slower than the sender.eiscan
@hardillb But it seems to open a tail in the rabbitmq panel.eiscan

1 Answers

0
votes

Using rabbitmqctl you can directly set maximum length for queue using policies instead of doing that using client libraries.

Example:

rabbitmqctl set_policy my-pol "^one-meg$" '{"max-length-bytes":1048576}' --apply-to queues

Take a look on Queue Length Limit in official docs.