Hi Alexis<br><br>My system is similar to an IM system and is using RabbitMQ for presence updates and have designed it in such a way that a consumer subscribes to a queue only when it comes online.Now the issue is as stated by you there will be a large no of messages ready to be deleivered when a user comes online. Checking timestamp for each message will result in high cost.<br>
<br>There can be a solution in which a message can be published using immediate flag. But it is desired by consumer to get all messages which are less than 1 minute old. <br><br>Can you suggest some other solution for achieving this?<br>
<br>Thanks <br>Gagan Arora<br><br><br><br><br><div class="gmail_quote">On Sat, Jul 4, 2009 at 3:32 PM, Alexis Richardson <span dir="ltr"><<a href="mailto:alexis.richardson@gmail.com">alexis.richardson@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Gagan,<br>
<div class="im"><br>
On Fri, Jul 3, 2009 at 5:08 PM, GAGAN ARORA<<a href="mailto:gaganarora.itm@gmail.com">gaganarora.itm@gmail.com</a>> wrote:<br>
> Hi Alexis<br>
> The problem statement here is I dont want my messages in queue for more than<br>
> 1 minute.<br>
<br>
</div>The easiest way to do this is for the client to keep consuming the<br>
messages from the queue.<br>
<br>
However: presumably you want messages to be ignored in the case where<br>
(a) there is no consumer to get the messages from the queue; and (b)<br>
the messages are more than one minute old.<br>
<br>
If so then: Have you considered putting a timestamp on the messages?<br>
That way, when a consumer starts taking messages from the queue, it<br>
can simply check the timestamps and throw away anything 'old'. This<br>
solution works just fine when (i) you don't need real time accuracy<br>
ie. "about a minute" is just as good as "exactly a minute", and<br>
provided that (ii) there aren't too many messages to throw away.<br>
Judging by the document that you sent, both (i) and (ii) are true.<br>
<br>
Does this help?<br>
<font color="#888888"><br>
alexis<br>
</font><div><div></div><div class="h5"><br>
<br>
> I have tried expiration property while publishing a message but<br>
> later came to know that it is still not implemented. Can you help me out in<br>
> figuring some alternate approach?<br>
> Thanks<br>
> Gagan Arora<br>
><br>
> On Fri, Jul 3, 2009 at 8:17 PM, Alexis Richardson<br>
> <<a href="mailto:alexis.richardson@gmail.com">alexis.richardson@gmail.com</a>> wrote:<br>
>><br>
>> Gagan,<br>
>><br>
>> On Fri, Jul 3, 2009 at 3:10 PM, GAGAN ARORA<<a href="mailto:gaganarora.itm@gmail.com">gaganarora.itm@gmail.com</a>><br>
>> wrote:<br>
>> > Hi<br>
>> > Is it possible to set message time out in Java client API, so that<br>
>> > messages<br>
>> > drop out from queue after some interval of time if nobody consumes it?.<br>
>><br>
>> Not yet but this is a feature have been asking for quite a bit. It's<br>
>> on our roadmap.<br>
>><br>
>> There may be other ways to achieve what you want.<br>
>><br>
>> alexis<br>
>><br>
>><br>
>><br>
>> > Thanks<br>
>> > Gagan Arora<br>
>> > _______________________________________________<br>
>> > rabbitmq-discuss mailing list<br>
>> > <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
>> > <a href="http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
>> ><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br>