Hi,
> Hi David,
>
> Message distribution in RabbitMQ (well, AMQP 0-9-1) happens at the routing stage,
> so with N consumers you will have N queues (if each service needs to get its own copy).
What's this look like in terms of the queue's? I'm looking at the Ruby
examples like
http://www.rabbitmq.com/tutorials/tutorial-four-ruby.html
which has this as the queue setup:
q = ch.queue("", :exclusive => true)
What do I need to change in that example to make things work like so:
1. Start two receivers
2. Send a message: they both get it.
3. Bring down one of the receivers
4. Send a message.
5. Bring it back up - it gets the message.
Do I need to give the queues names, or make them durable, or something
else? I'm guessing names so that it was something permanent to deal
with that it knows ought to come back?
> If a consumer goes down or cannot process a delivery, it can re-queue it (note: if there's only
> one consumer it will immediately get a redelivery; message TTL can help with that to some extent).
> Consumers also can lose network connections, RabbitMQ will notice and re-queue unacknowledged
> deliveries automatically. This is covered in
http://www.rabbitmq.com/confirms.html, as a publisher
> confirms, a very important and relevant topic.
Ok, I added ch.confirm_select to the above example, but doesn't do
what I want.
> Now, I'm not sure what you mean by "initial fetch of everything" but messages in RabbitMQ can be consumed
> and acknowledged only once (and only one consumer can have an outstanding delivery at a time — see above).
> There is no way to read the history of messages. If that feature is crucial to have, use Kafka, which is a hybrid
> messaging/data store service.
Yeah, I suspected RabbitMQ might not be the right tool for that
particular part of the job. Was just throwing it out there to see if
anyone had ideas. I'm not sure Kafka is what I want either, to be
honest; I don't like of storing thte data in one place, and then
storing the whole queue of the same data, but that's what it'd take to
be able to do a "seed" of a new app's database. More thinking, I
guess. Thanks for the suggestion in any case!
> I'm also not sure what you mean by "Something missing from the existing system is handling of 'deletion' events."
> Can you elaborate?
Say a user is deleted in the main database. That event needs to be
propagated through the rest of the system, probably with some kind of
message including the user ID and a delete flag. It's not really
RabbitMQ specific - it's missing in our system. I was sort of hoping
someone might have seen this 'pattern' of usage and have some ideas.
Thank you!