You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a use case where messages can have priorities say 1-3, now 1 is system generated message and 3 is user generated message. Normally the messages are consumed in order and highest priority is consumed first as rabbitmq will deliver messages based on priority.
Now there are certain times when we might want to do maintenance and the capacity of the servers that serve the consumers is low so we want to only consume messages with priority 3 and hold off on the other ones.
I can think of three ways to do this
Have separate queues for all priorities and disable getting messages from the low priority ones - this would mean each "consumer" has to consume from 3 different queues. I'm not sure how you would control the qos such that high priority ones are always served first.
Have 1 queue only and nack the message so it's redelivered. This causes a very high redelivery rate during maintenance and I'm not sure if there are negative impacts of this. I could put a sleep before nack-ing the msg so the rate is slower but that also means incoming requests from user will have a minor delay.
Have a dead letter queue with ttl that puts the message back to the main queue - I found this somewhere online but my problem with this is that you might lose the ordering of the messages. I guess it would be fine if all of the messages just go to the dead letter queue and then would be redelivered in the same order.
I feel option 3 would be the best in terms of wasted effort in redelivering messages as all of them would just go to a different queue and come back after some time. Option 2 would also work out and it has the benefit of simplicity where you don't have to set up a circuit and maintain a dead letter queue. Option 1 feels like a lot of work to me and not worth it.
This is my first time creating a message based system so I'm not really sure how to handle the maintenance aspect of it. Is there a better way to do this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have a use case where messages can have priorities say 1-3, now 1 is system generated message and 3 is user generated message. Normally the messages are consumed in order and highest priority is consumed first as rabbitmq will deliver messages based on priority.
Now there are certain times when we might want to do maintenance and the capacity of the servers that serve the consumers is low so we want to only consume messages with priority 3 and hold off on the other ones.
I can think of three ways to do this
I feel option 3 would be the best in terms of wasted effort in redelivering messages as all of them would just go to a different queue and come back after some time. Option 2 would also work out and it has the benefit of simplicity where you don't have to set up a circuit and maintain a dead letter queue. Option 1 feels like a lot of work to me and not worth it.
This is my first time creating a message based system so I'm not really sure how to handle the maintenance aspect of it. Is there a better way to do this?
Beta Was this translation helpful? Give feedback.
All reactions