Hi,

The broadcast operation sends an event to all existing PE instances on all nodes. In your case, you probably had 1 instance in two nodes, 2 instances in another node and no instances in the last node. This operation might be useful for notifying all instances of some event, such as the need to persist data, invalidating the cache, etc.

If you wanted to process some event once on each node, you could broadcast it to a PE marked as singleton. Singleton PEs have one (and only one) instance on each node, so broadcasting to them ensures the event is processed once on each node.

I hope this clarifies things.

Cheers,

Daniel


On Tue Apr 23 03:06:17 2013, 唐装鼠 wrote:
Hi,as you say,within an S4 cluster, events are dispatched according
to their key + hashing and mod . To broadcast, use a null key.
However,when I dispatch an event with a stream without keyfinder,it is
not really broadcasted.
The real situation is:
I builded 4 nodes running in cluster1.Idispatched an event with a
stream without keyfinder.
The result is that ,of the four nodes,two received the event,one
received the event twice,and the remained one didn't receive the event.
I don't know where I was wrong.Would you like to help me?

------------------ 原始邮件 ------------------
*发件人:* "Matthieu Morel"<mmo...@apache.org>;
*发送时间:* 2013年4月15日(星期一) 晚上11:15
*收件人:* "s4-user"<s4-user@incubator.apache.org>;
*主题:* Re: 回复: event dispatch


On Apr 15, 2013, at 15:50 , 唐装鼠 wrote:



As you say,within an S4 cluster, events are dispatched according to
their key + hashing and mod.
I want to dispatch events in adapter app and dispatch events by
hashing on one string which I set myself.How to implement?

Have a look at the KeyFinder , it is used to identify extract keys
from events.

Matthieu


------------------ 原始邮件 ------------------
*发件人:* "Matthieu Morel"<mmo...@apache.org <mailto:mmo...@apache.org>>;
*发送时间:* 2013年4月15日(星期一) 晚上9:35
*收件人:* "s4-user"<s4-user@incubator.apache.org
<mailto:s4-user@incubator.apache.org>>;
*主题:* Re: event dispatch

Hi,

within an S4 cluster, events are dispatched according to their key +
hashing and mod , so there is no round-robin. To broadcast, use a
null key.

Across S4 clusters inter-app communication, (e.g. when injecting
events from an adapter), keyless events (null key) are distributed in
a round robin fashion.

Hope this helps,

Matthieu



On Apr 14, 2013, at 04:35 , 唐装鼠 wrote:

> Hi,I am new to S4.I want to know how to dispatch events to nodes.
> Including:
> How to dispatch events in a round robin fashion?
> How to dispatch one event to all nodes?
> How to dispatch one event to a particular node?
> Thanks!

.

Reply via email to