Ask is moving to Stack Overflow and! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode


Data Change Listeners and Cluster

asked 2015-08-10 21:34:31 -0700

Jon Castro gravatar image

My application requires all instances being notified when there is a data change in a Opendaylight cluster environment. Currently, only one instance (or member) of the cluster is being notified when there is a data change in the model.

Is it possible to register the listeners to be notified all of them? I did not found anything in the API to force this behaviour.

I'm using following configuration and code to register the listeners

In the Module create instance method

        final ListenerRegistration<DataChangeListener> dataChangeDevicesListenerRegistration =
                    CliconfProvider.DEVICES_IID, appProvider, DataChangeScope.SUBTREE);

In the application provider-impl.yang file

container data-broker {
            uses config:service-ref {
                refine type {
                    mandatory false;
                    config:required-identity mdsal:binding-async-data-broker;
edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted

answered 2015-08-30 15:13:18 -0700

Robert Varga gravatar image

Data(Tree)ChangeListeners are currently notified only on the node with is co-located with the corresponding shard leader. Not sure there is an enhancement open for it, though.

edit flag offensive delete publish link more


There is a gerrit which is available for clusterwide notifications - I am yet to test this though ...

Muthukumaran ( 2015-09-12 05:45:58 -0700 )edit

answered 2015-09-12 08:06:02 -0700

Muthukumaran gravatar image

@Jon Castro Though above gerrit enables notifications across cluster nodes (all members of a specific shard - to be precise), you might want to consider your listener design from following perspective

For single datachange notification, listener code is going to execute more than once across cluster for symmetric cluster - same code runs everywhere

Depending upon your use-case, this may or may not be a functional issue - but certainly could turn-out to be inefficient

Regards Muthu

edit flag offensive delete publish link more

answered 2016-12-26 01:13:53 -0700

simpler gravatar image

Hi,you can implement ClusteredDataTreeChangeListener instead of DataTreeChangeListener and register a datatreechange listener to the datanode which you want to detect.

when other instances have changed this datanode then that will be listened.

Regards Simpler

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-08-10 21:34:31 -0700

Seen: 752 times

Last updated: Dec 26 '16