Version

    Universal Event Listeners

    Since 2.10

    Universal Event Listeners allow you to write a piece of Groovy code that controls when an event is triggered, subsequently executing a predefined task. The Groovy code is periodically executed and when it returns TRUE, the task is executed.

    Table 38.7. Attributes of Universal message task

    AttributeDescription
    Node IDs to handle the event

    In a Cluster environment, each universal event listener has a Node IDs attribute which may be used to specify which Cluster node performs the Groovy code. There are following possibilities:

    • No failover: Just one node ID specified - Only the specified node performs the Groovy code, however node status must be "ready". When the node isn't ready, the code isn't performed at all.

    • Failover with node concurrency: No node ID specified (empty input) - All Cluster nodes with the status "ready" concurrently perform the Groovy code. So the code is executed on each node in the specified interval.

    • Failover with node reservation: More node IDs specified (separated by a comma) - Just one of the specified nodes performs the Groovy code. If the node fails for any reason (or its status isn't "ready"), any other "ready" node from the list continues with periodical Groovy code processing.

    In a standalone environment, the Node IDs attribute is ignored.

    Interval of check in secondsPeriodicity of Groovy code execution.
    Groovy code

    Groovy code that evaluates either to TRUE (execute the task) or FALSE (no action). See below for more details.


    Groovy code

    A piece of Groovy is repeatedly executed and evaluated; based on the result, the event is either triggered and the task executed or no action is taken.

    For example, you can continually check for essential data sources before starting a graph. Or, you can do complex checks of a running graph and, for example, decide to kill it if necessary. You can even call the CloverDX Server Core functions using the ServerFacade interface, see Javadoc: http://host:port/clover/javadoc/index.html