Hi Srinath, While reading this the question came in to my mind was how this addresses the problem we were trying to solve using high and low water mark levels. So I had an offline discussion with Shammi and came up with the following solution.
1. When we receive messages, if there is no subscription, rather than taking the slot and writing all the messages to that slot create multiple number of slots which have messages up to HWM level. 2. If a queue has subscriptions from multiple nodes, then we will give it several slots, assign those slots to corresponding nodes. When distributing messages to those slots copy only messages up to HWM level. What do you think? Thank you, Sajini. On Thu, Jul 24, 2014 at 3:09 PM, Srinath Perera <[email protected]> wrote: > Currently we use Global queue to handle the scenario where we receive > messages for a queue that does not have any subscriptions. However, due to > this large latency is added and message need to copied around lot. > > Shammi and myself were discussing and look like it is possible to remove > it completely. Following is the proposal. > > > 1. We define a concept called slots where we can store messages in > Cassandra. Each slot map to a row in Cassandra or a RDBMS table. There are > queuesCount X nodeCount slots in the system. > 2. Only one node own a slot at a time. When the node own the slot, it > reads messages from the slot and send to subscribers. (This is what > QueueDeliveryWorker do). This slot assignment we can manage via hazecast. > 3. When we receive messages, if there is no subscription, we take a > slot and write messages to that slot. When there is subscription to that > queue, we assign the slot to associated node for subscription. > 4. If a queue has subscriptions from multiple nodes, then we will give > it several slots, assign those slots to corresponding nodes.The we > distribute messages to those slots. > 5. With this model, each message will be only written once and read > once mostly. > 6. There will be some edge cases (e.g. when a node run out > subscriptions etc) where we might need to merge or split messages in slots. > These we have to do carefully, but since those are rare, the overhead added > is minimal. > 7. Each query delivery worker would need to read a slot for each > queue. So we need to keep a thread pool and manage reading. > > This should also reduce number of Cassandra calls by about 50%. > > WDYT? > > --Srinath > > -- > ============================ > Srinath Perera, Ph.D. > http://people.apache.org/~hemapani/ > http://srinathsview.blogspot.com/ > > _______________________________________________ > Architecture mailing list > [email protected] > https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture > > -- Sajini De SIlva Software Engineer; WSO2 Inc.; http://wso2.com , Email: [email protected] Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
