[rabbitmq-discuss] Help defining appropriate queue model

Alexis Richardson alexis at rabbitmq.com
Wed Mar 2 17:11:34 GMT 2011


On Wed, Mar 2, 2011 at 4:57 PM, Fabio Margarido
<fabiomargarido at gmail.com> wrote:
>>> * The producer publishes the message before any consumers are running;
>>
>> Do you want a new consumer to see all old updates, or just the latest
>> update that occurred before the new consumer connects to the broker?
>
> I want the consumers to see just the latest update. But I figured that
> as the queue is exclusive and so gets created only the moment it
> starts running, it wouldn't get the message that was published prior
> to that.

Correct.

If you want the broker to retain messages published before any
consumers appear, then get the publisher to create a queue for them.
But what happens to those messages, is an application level decision
you will have to make...



>>> * The consumer receives the message, dies and reboots, consumes the
>>> same message once more.
>>
>> You can set things up so that the message gets requeued, but not 'in order'.
>
> Order shouldn't matter, as I'm only interested in that latest update.

Yes but if a message gets requeued, it will go to the back of the
(FIFO) queue.  You can work around this by attaching an application
level stamp.


>> I'd tentatively suggest that you may be talking more about a cache
>> than message queue.
>
> It is a kind of cache. I guess it could be done a number of different
> ways, like setting up an NFS share and storing the config in a file or
> maybe set something up in the application servers. But I figured that
> since I already have the RabbitMQ infrastructure up and running for my
> other (more orthodox) messaging needs, I might as well take advantage
> of it for this case rather than having to maintain another service.
> Thanks.

No problem.

alexis


More information about the rabbitmq-discuss mailing list