Alexis<br><br>a) when the User A is not logged into server 1 or server 2, any<br>
messages sent to them by User B are discarded<br>&gt;&gt; Actually during this case no consumer would be listening to User A queue and hence the messages can&#39;t be discarded and would be queued in Queue.<br><br>b) but, when User A is logged in to server 1, any messages sent by<br>

User B that may be routed to User A are queued in Queue A, <br>&gt;&gt; No of messages increases.<br><br>
c) .... delivered when User A logs into server 2.<br>&gt;&gt; A large no of messages get delieverd.<br><br>It is a constraint in my system that I have to initialize consumer when User A connects to Server2.<br><br><div class="gmail_quote">
On Mon, Jul 6, 2009 at 9:28 PM, Alexis Richardson <span dir="ltr">&lt;<a href="mailto:alexis.richardson@gmail.com">alexis.richardson@gmail.com</a>&gt;</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>
<br>
As I understood from your document:<br>
<br>
a) when the User A is not logged into server 1 or server 2, any<br>
messages sent to them by User B are discarded<br>
b) but, when User A is logged in to server 1, any messages sent by<br>
User B that may be routed to User A are queued in Queue A, and then<br>
...<br>
c) .... delivered when User A logs into server 2.<br>
<br>
Provided that you can implement this efficiently (see other email)<br>
then the consumer at User A only needs to discard messages that are<br>
older than one minute, and that were not already discarded due to (a)<br>
above. �So unless the time interval between A logging into server 1,<br>
and A logging into server 2, is &quot;quite long&quot; then the &#39;timestamp&#39;<br>
method adds very little overhead.<br>
<br>
Is that correct or have I missed something?<br>
<font color="#888888"><br>
alexis<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
<br>
<br>
<br>
On Sat, Jul 4, 2009 at 8:28 PM, GAGAN ARORA&lt;<a href="mailto:gaganarora.itm@gmail.com">gaganarora.itm@gmail.com</a>&gt; wrote:<br>
&gt; Hi Alexis<br>
&gt;<br>
&gt; My system is similar to an IM system and is using RabbitMQ for presence<br>
&gt; updates and have designed it in such a way that a consumer subscribes to a<br>
&gt; queue only when it comes online.Now the issue is as stated by you there will<br>
&gt; be a large no of messages ready to be deleivered when a user comes online.<br>
&gt; Checking timestamp for each message will result in high cost.<br>
&gt;<br>
&gt; There can be a solution in which a message can be published using immediate<br>
&gt; flag. But it is desired by consumer to get all messages which are less than<br>
&gt; 1 minute old.<br>
&gt;<br>
&gt; Can you suggest some other solution for achieving this?<br>
&gt;<br>
&gt; Thanks<br>
&gt; Gagan Arora<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Sat, Jul 4, 2009 at 3:32 PM, Alexis Richardson<br>
&gt; &lt;<a href="mailto:alexis.richardson@gmail.com">alexis.richardson@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Gagan,<br>
&gt;&gt;<br>
&gt;&gt; On Fri, Jul 3, 2009 at 5:08 PM, GAGAN ARORA&lt;<a href="mailto:gaganarora.itm@gmail.com">gaganarora.itm@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; Hi Alexis<br>
&gt;&gt; &gt; The problem statement here is I dont want my messages in queue for more<br>
&gt;&gt; &gt; than<br>
&gt;&gt; &gt; 1 minute.<br>
&gt;&gt;<br>
&gt;&gt; The easiest way to do this is for the client to keep consuming the<br>
&gt;&gt; messages from the queue.<br>
&gt;&gt;<br>
&gt;&gt; However: presumably you want messages to be ignored in the case where<br>
&gt;&gt; (a) there is no consumer to get the messages from the queue; and (b)<br>
&gt;&gt; the messages are more than one minute old.<br>
&gt;&gt;<br>
&gt;&gt; If so then: Have you considered putting a timestamp on the messages?<br>
&gt;&gt; That way, when a consumer starts taking messages from the queue, it<br>
&gt;&gt; can simply check the timestamps and throw away anything &#39;old&#39;. �This<br>
&gt;&gt; solution works just fine when (i) you don&#39;t need real time accuracy<br>
&gt;&gt; ie. &quot;about a minute&quot; is just as good as &quot;exactly a minute&quot;, and<br>
&gt;&gt; provided that (ii) there aren&#39;t too many messages to throw away.<br>
&gt;&gt; Judging by the document that you sent, both (i) and (ii) are true.<br>
&gt;&gt;<br>
&gt;&gt; Does this help?<br>
&gt;&gt;<br>
&gt;&gt; alexis<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; &gt; I have tried expiration property while publishing a message but<br>
&gt;&gt; &gt; later came to know that it is still not implemented. Can you help me out<br>
&gt;&gt; &gt; in<br>
&gt;&gt; &gt; figuring some alternate approach?<br>
&gt;&gt; &gt; Thanks<br>
&gt;&gt; &gt; Gagan Arora<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Fri, Jul 3, 2009 at 8:17 PM, Alexis Richardson<br>
&gt;&gt; &gt; &lt;<a href="mailto:alexis.richardson@gmail.com">alexis.richardson@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Gagan,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; On Fri, Jul 3, 2009 at 3:10 PM, GAGAN ARORA&lt;<a href="mailto:gaganarora.itm@gmail.com">gaganarora.itm@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt; Hi<br>
&gt;&gt; &gt;&gt; &gt; Is it possible to set message time out in Java client API, so that<br>
&gt;&gt; &gt;&gt; &gt; messages<br>
&gt;&gt; &gt;&gt; &gt; drop out from queue after some interval of time if nobody consumes<br>
&gt;&gt; &gt;&gt; &gt; it?.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Not yet but this is a feature have been asking for quite a bit. �It&#39;s<br>
&gt;&gt; &gt;&gt; on our roadmap.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; There may be other ways to achieve what you want.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; alexis<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt; Thanks<br>
&gt;&gt; &gt;&gt; &gt; Gagan Arora<br>
&gt;&gt; &gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; &gt; rabbitmq-discuss mailing list<br>
&gt;&gt; &gt;&gt; &gt; <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
&gt;&gt; &gt;&gt; &gt; <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>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>