Alexis<div><br></div><div>But my design says queue must be bind to an exchange when user is created and not at time User connects to server 1.</div><div><br></div><div>Gagan<br><br><div class="gmail_quote">On Tue, Jul 7, 2009 at 2:25 AM, 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="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Mon, Jul 6, 2009 at 8:17 PM, GAGAN ARORA<<a href="mailto:gaganarora.itm@gmail.com">gaganarora.itm@gmail.com</a>> wrote:<br>
> Alexis<br>
><br>
</div><div class="im">> Actually dropping out messages from queue is another problem I am facing and<br>
> is following it on another thread with you. In this case I am assuming there<br>
> is no dropping out of messages from queue if there is no consumer is<br>
> listening to the queue and a message is always queued up in queue.<br>
<br>
</div>Messages will get dropped by an exchange X instead of being put in a<br>
queue Q, when Q is not bound to X.<br>
<br>
So to go through your case:<br>
<div class="im"><br>
"Case1: User B sending his message to UserB Exchange which will route<br>
message to User A queue but User A is not connected to any of servers.<br>
At this point of all messages sent to Queue A should be dropped."<br>
<br>
</div>The property you want is:<br>
<br>
* When User A is not connected to any of servers<br>
* Then all messages sent to Queue A should be dropped<br>
<br>
This is true IF when User A is not connected to any of the servers,<br>
THEN queue A is not bound to any exchanges.<br>
<br>
This has *nothing* to do with consumers or what they are 'listening' to.<br>
<br>
So - when User A is not connected then (if above) messages for A get<br>
dropped. Easy peasy.<br>
<font color="#888888"><br>
alexis<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
<br>
<br>
> Thanks<br>
> Gagan<br>
><br>
> On Tue, Jul 7, 2009 at 12:03 AM, Alexis Richardson<br>
> <<a href="mailto:alexis.richardson@gmail.com">alexis.richardson@gmail.com</a>> wrote:<br>
>><br>
>> Gagan,<br>
>><br>
>> On Mon, Jul 6, 2009 at 7:02 PM, GAGAN ARORA<<a href="mailto:gaganarora.itm@gmail.com">gaganarora.itm@gmail.com</a>><br>
>> wrote:<br>
>> > 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>
>> >>> Actually during this case no consumer would be listening to User A<br>
>> >>> queue<br>
>> >>> and hence the messages can't be discarded and would be queued in<br>
>> >>> Queue.<br>
>><br>
>> In your document you said:<br>
>><br>
>> "Case1: User B sending his message to UserB Exchange which will route<br>
>> message to User A queue but User A is not connected to any of servers.<br>
>> At this point of all messages sent to Queue A should be dropped."<br>
>><br>
>> If this is happening then the messages will be discarded and not<br>
>> queued in Queue.<br>
>><br>
>> alexis<br>
>><br>
>><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>
>> >>> No of messages increases.<br>
>> ><br>
>> > c) .... delivered when User A logs into server 2.<br>
>> >>> A large no of messages get delieverd.<br>
>> ><br>
>> > It is a constraint in my system that I have to initialize consumer when<br>
>> > User<br>
>> > A connects to Server2.<br>
>> ><br>
>> > On Mon, Jul 6, 2009 at 9:28 PM, Alexis Richardson<br>
>> > <<a href="mailto:alexis.richardson@gmail.com">alexis.richardson@gmail.com</a>> wrote:<br>
>> >><br>
>> >> 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 "quite long" then the 'timestamp'<br>
>> >> method adds very little overhead.<br>
>> >><br>
>> >> Is that correct or have I missed something?<br>
>> >><br>
>> >> alexis<br>
>> >><br>
>> >><br>
>> >><br>
>> >><br>
>> >><br>
>> >><br>
>> >> On Sat, Jul 4, 2009 at 8:28 PM, GAGAN ARORA<<a href="mailto:gaganarora.itm@gmail.com">gaganarora.itm@gmail.com</a>><br>
>> >> wrote:<br>
>> >> > Hi Alexis<br>
>> >> ><br>
>> >> > My system is similar to an IM system and is using RabbitMQ for<br>
>> >> > presence<br>
>> >> > updates and have designed it in such a way that a consumer subscribes<br>
>> >> > to<br>
>> >> > a<br>
>> >> > queue only when it comes online.Now the issue is as stated by you<br>
>> >> > there<br>
>> >> > will<br>
>> >> > be a large no of messages ready to be deleivered when a user comes<br>
>> >> > online.<br>
>> >> > 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<br>
>> >> > immediate<br>
>> >> > flag. But it is desired by consumer to get all messages which are<br>
>> >> > less<br>
>> >> > than<br>
>> >> > 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>
>> >> > On Sat, Jul 4, 2009 at 3:32 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 5:08 PM, GAGAN<br>
>> >> >> ARORA<<a href="mailto:gaganarora.itm@gmail.com">gaganarora.itm@gmail.com</a>><br>
>> >> >> wrote:<br>
>> >> >> > Hi Alexis<br>
>> >> >> > The problem statement here is I dont want my messages in queue for<br>
>> >> >> > more<br>
>> >> >> > than<br>
>> >> >> > 1 minute.<br>
>> >> >><br>
>> >> >> 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<br>
>> >> >> 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>
>> >> >><br>
>> >> >> alexis<br>
>> >> >><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<br>
>> >> >> > me<br>
>> >> >> > out<br>
>> >> >> > 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<br>
>> >> >> >> 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<br>
>> >> >> >> > that<br>
>> >> >> >> > messages<br>
>> >> >> >> > drop out from queue after some interval of time if nobody<br>
>> >> >> >> > consumes<br>
>> >> >> >> > it?.<br>
>> >> >> >><br>
>> >> >> >> Not yet but this is a feature have been asking for quite a bit.<br>
>> >> >> >> 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>
>> >> >> >> ><br>
>> >> >> >> ><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>
>> >> ><br>
>> >> ><br>
>> ><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br></div>