[infinispan-dev] design for cluster events (wiki page)

Mircea Markus mmarkus at redhat.com
Thu Oct 31 09:28:53 EDT 2013


On Oct 31, 2013, at 1:19 PM, Bela Ban <bban at redhat.com> wrote:

> On 10/31/13 1:05 PM, Mircea Markus wrote:
>> 
>> On Oct 31, 2013, at 7:10 AM, Bela Ban <bban at redhat.com> wrote:
>> 
>>> Just to clarify, can you comment on whether the statements below are true ?
>>> 
>>> #1 When mode=repl is used, the event itself is never broadcast; it is
>>> always local and no communication is needed
>> 
>> yes. for replicated caches we should handle this as a local listener.
>> 
>>> 
>>> #2 when mode=dist, is the event broadcast synchronously or
>>> asynchronously, can this be configured ? I think it doesn't make sense
>>> to broadcast the event synchronously in dist-async, for instance.
>> 
>> there are two levels of asynchronicity:
>> - the cluster is configured to be asyn
>> - the listeners can be configured to be notified in an async thread (@Listener async=true)
>> In both situations the notification from the event should be broadcasted asynchronously
> 
> Ah, ok, so the events are *always* async ?

Not always async actually: if we have an sync cluster and the listener is configured as @Listener(sync=true)[1] then the notification is processed synchronously and the ordering guarantee honored. 
If either the cluster is configured with async replication/distribution or @Listener(sync=false) then the events can be delivered *async* from the nodes were the filter is registered. This should be documents.

[1] http://docs.jboss.org/infinispan/6.0/apidocs/org/infinispan/notifications/Listener.html#sync()

> +1 in general, but there's a 
> point where you mentioned ordering, and ordering might get destroyed if 
> you switch to async.

Cheers,
-- 
Mircea Markus
Infinispan lead (www.infinispan.org)







More information about the infinispan-dev mailing list