Search code examples
rabbitmqamqp

AMQP binding and message removing


How to remove message from a queue , in a bining configuration, once the message has been consumed?

Example:

I have

topic.1, topic.2, topic.3,...etc

I have two binding, like my_topic which is binded to topic.1 and all_topic which is binded to topic.#

my_topic is high priority, and messages are consumed normally, but remains in the topic.# binding. So how can I remove them from the topic.# so they are not consumed twice?

Thanks in advance


Solution

  • Split your topics in more queues. So instead of having one queue subscribed to messages with routing key "users.*", create one for each routing key: "users.created", "users.updated", "users.deleted". Then you can create new consumers to bind to this queue on the fly when you have more load in one kind of message.