Yegor Lukash
Yegor Lukash

Reputation: 510

Resend messages from RabbitMQ works strange

I have RabbitMQ cluster in docker images. RabbitMQ have 1 exchange "EventExchange" and 2 queues: "QueueWait" and "QueueAction". Queues configured for resend:

And consumer listens QueueAction.

Logic

  1. Message is inserted into queue QueueWait with variable expiration time
  2. After expiration message is moved from QueueWait to QueueAction
  3. Consumer listening QueueAction got message

Problem

Today I had problem. Expired messages are not moved between QueueWait and QueueAction. But if I get all messages from QueueWait in default GUI of RabbitMQ they will be moved to the QueueAction succesfully

Environment

UPD:

I have to set TTL on the message level, because I have variable expiration dependet on the attempts of resend. How will I able to save current logic with guaranteed resend?

Upvotes: 0

Views: 388

Answers (1)

old_sound
old_sound

Reputation: 2313

Take a look at https://www.rabbitmq.com/ttl.html#per-message-ttl-caveats

RabbitMQ expires messages when they reach the head of the queue, so if you don't have consumers, most probably your messages won't get expired.

Upvotes: 1

Related Questions