On 8 Jan 2010, at 13:05, Mircea Markus wrote:
>
> I can see how they can be abused to form a JMS-like message-passing layer, but then a
lot of stuff could be open to abuse. Perhaps the events should just be restricted to
notifying when a key has changed (i.e., a bit like Invalidation) but with no
values/payload passed on, forcing the client to do a GET if the value was required.
Once we have the server->client notification mechanism working IMO we should allow the
user to decide which notifications he wants to listen to, and not be restrictive about it.
Re:key change notifications, I'm not sure that will work with the current ISP
architecture: right now the notifications are local, i.e. one will only be notified by the
keys changed in the local cache. So if a used want to be notified when the
"account" key changed, that will only happen if he is connected to the server on
which the "account" key was hashed. Even more, if he will connect to another
server, which contains "account", the notification behavior might be different,
which might be confusing.
Not a protocol design expert, but is it common for this "push" approach for
protocols?
Well, any form of notification beyond keys would be much too expensive. Although this can
be hidden from the user by using a proxy Event object which has a key but lazily loads the
value when Event.getValue() is invoked.
Re: the global scope of events, this is important/interesting.
Client ----> ServerA, ServerB, ServerC ... Server Z
Assuming the client has a connection to A, and registers interest in keys k1... k3, you
are correct that ServerA would only be aware of changes on keys located on ServerA and not
globally. Solutions may be that ServerA acts as a proxy for the Client and registers for
events on other servers on the clients' behalf? No simple answers here I'm
afraid...
Cheers
--
Manik Surtani
manik(a)jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org