mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Add broadcast_topics set.
This set contains the topics to reach all cluster nodes. Due to broker's forwarding mechanism, we cannot define a single broadcast topic, as it would create routing loops.
This commit is contained in:
parent
3db8bb4a44
commit
c7626d797f
2 changed files with 9 additions and 8 deletions
|
@ -44,6 +44,13 @@ export {
|
||||||
## time machine nodes in a cluster. Used with broker-enabled cluster communication.
|
## time machine nodes in a cluster. Used with broker-enabled cluster communication.
|
||||||
const time_machine_topic = "zeek/cluster/time_machine" &redef;
|
const time_machine_topic = "zeek/cluster/time_machine" &redef;
|
||||||
|
|
||||||
|
## A set of topic names to be used for broadcasting messages that are
|
||||||
|
## relevant to all nodes in a cluster. Currently, there is not a common
|
||||||
|
## topic to broadcast to, because enabling implicit Broker forwarding would
|
||||||
|
## cause a routing loop for this topic.
|
||||||
|
const broadcast_topics = { logger_topic, manager_topic, proxy_topic,
|
||||||
|
worker_topic, time_machine_topic };
|
||||||
|
|
||||||
## The topic prefix used for exchanging messages that are relevant to
|
## The topic prefix used for exchanging messages that are relevant to
|
||||||
## a named node in a cluster. Used with broker-enabled cluster communication.
|
## a named node in a cluster. Used with broker-enabled cluster communication.
|
||||||
const node_topic_prefix = "zeek/cluster/node/" &redef;
|
const node_topic_prefix = "zeek/cluster/node/" &redef;
|
||||||
|
|
|
@ -59,14 +59,8 @@ global Config::cluster_set_option: event(ID: string, val: any, location: string)
|
||||||
|
|
||||||
function broadcast_option(ID: string, val: any, location: string) &is_used
|
function broadcast_option(ID: string, val: any, location: string) &is_used
|
||||||
{
|
{
|
||||||
# There's not currently a common topic to broadcast to as then enabling
|
for ( topic in Cluster::broadcast_topics )
|
||||||
# implicit Broker forwarding would cause a routing loop.
|
Broker::publish(topic, Config::cluster_set_option, ID, val, location);
|
||||||
Broker::publish(Cluster::worker_topic, Config::cluster_set_option,
|
|
||||||
ID, val, location);
|
|
||||||
Broker::publish(Cluster::proxy_topic, Config::cluster_set_option,
|
|
||||||
ID, val, location);
|
|
||||||
Broker::publish(Cluster::logger_topic, Config::cluster_set_option,
|
|
||||||
ID, val, location);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
event Config::cluster_set_option(ID: string, val: any, location: string)
|
event Config::cluster_set_option(ID: string, val: any, location: string)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue