[rabbitmq-discuss] Losing messages, why?
DOBRO
vertolet666 at yandex.ru
Fri Feb 18 13:42:24 GMT 2011
Hi,
I've run into the issue of losing messages. I'm trying to figure out why
messages are lost, but can't understand yet.
I'm using RabbitMQ 2.3.1, Erlang R14B01.
Let me tell you how I organized messaging.
Several exchanges are declared:
all.fanout (type => 'fanout', passive => false, durable => false,
auto_delete => false);
main.direct (type => 'direct', passive => false, durable => false,
auto_delete => false);
board.direct (type => 'direct', passive => false, durable => false,
auto_delete => false);
boardchat.direct (type => 'direct', passive => false, durable => false,
auto_delete => false);
First client (Client1) connects to RabbitMQ and declares queue:
main_queue (passive => false, durable => false, exclusive => true,
auto_delete => false),
binds this main_queue to exchange main.direct with routing key "mainKey"
and starts to consume messages from main_queue with noAck = true.
This client is running on the server side.
Second client (Client2) (from other city or country) connects to RabbitMQ
and declares 4 queues (4 channels are opened: one channel per queue).
These 4 queues are:
all-queue-1 (passive => false, durable => false, exclusive => true,
auto_delete => false) is bound to exchange all.fanout,
board-queue-1 (passive => false, durable => false, exclusive => true,
auto_delete => false) is bound to exchange board.direct with routing key
"1234",
boardchat-queue-1 (passive => false, durable => false, exclusive => true,
auto_delete => false) is bound to exchange boardchat.direct with routing key
"1234",
Client2 starts consuming messages from queues all-queue-1, board-queue-1,
boardchat-queue-1 with noAck = true.
The third client (Client3) (from other city or country) connects to RabbitMQ
and declares 4 queues (4 channels are opened: one channel per queue).
These 4 queues are:
all-queue-2 (passive => false, durable => false, exclusive => true,
auto_delete => false) is bound to exchange all.fanout,
board-queue-2 (passive => false, durable => false, exclusive => true,
auto_delete => false) is bound to exchange board.direct with routing key
"1234",
boardchat-queue-2 (passive => false, durable => false, exclusive => true,
auto_delete => false) is bound to exchange boardchat.direct with routing key
"1234",
Client3 starts consuming messages from queues all-queue-2, board-queue-2,
boardchat-queue-2 with noAck = true.
Next,
- Client2 publishes a message (message1) to exchange main.direct with
routing key "mainKey",
- Client1 receives this message, processes it and publish another message
(message2) to exchange board.direct with routing key "1234",
- Client2 and Client3 receive the message (message2) from Client1 and
process it,
- Client2 starts to publish message2 to exchange board.direct with routing
key "1234" every 10 seconds.
Sometimes Client3 stops to receive messages from Client1 and Client2 (from
queue board-queue-2) (even if Client2 publishes messages every 10 seconds).
However, Client3 receives messages from all other queues.
If Client3
- deletes board-queue-2,
- closes the channel opened for this queue,
- opens another channel,
- declares queue board-queue-3 (passive => false, durable => false,
exclusive => true, auto_delete => false)
- binds the queue board-queue-3 to exchange board.direct with routing key
"1234",
- starts consuming messages from queue board-queue-3 with noAck = true
the situation comes to normal again.
Now I'm coming to a question.
Why Client3 loses messages? Where should I find a reason?
Thanks a lot!
--
View this message in context: http://old.nabble.com/Losing-messages%2C-why--tp30958766p30958766.html
Sent from the RabbitMQ mailing list archive at Nabble.com.
More information about the rabbitmq-discuss
mailing list