Filtering subscriptions on during 'cdb_trigger_subscriptions'

Hello Folks,
I am reloading my config CDB into subscriber app whenever it reloads. We translate this CDB data into our internal format and store it in main memory.
I have noticed that, while I get the subscriptions, I also get it for yang files used solely by tail-f. For eg: ‘tailf-acm.yang’.
Is there a way to filter out these cdb modifications from being received at the subscriber app?

We are subscribing at ‘/’ level using:

cdb_subscribe2 (sub_fd_, CDB_SUB_RUNNING_TWOPHASE, 0, 0, &sub_id_, 0, “/”)

And use the same ‘sub_id_’ while issuing trigger subscription:

cdb_trigger_subscriptions(reload_fd_, &sub_id_, 1)

I was hoping that based on the provided subscription id ‘sub_id_’, confd would only provide the modifications that the subscriber would be interested in.

Is there any ‘proper’ way to filter out such subscriptions ?


Since you are subscribing to the configuration root, you will receive all the configuration changes, including those that your subscriber may not be interested in. There are a couple of strategies that I can think of for handling these:

  1. Continue to subscribe to the configuration root, but you will just have to write the code to ignore the configuration changes you aren’t interested in.
  2. Don’t subscribe to the configuration root, but instead have multiple subscriptions, and only subscribe to the models you are interested in. Often when people write their YANG models, they will have a single top-level container that the rest of the configuration is part of. This makes a convenient single item to subscribe to for that model, instead of many items.

I would recommend the second strategy in general since you can simply subscribe to the models that your subscriber is written to handle. You can also use the subscription priority mechanism if you want to process the configuration changes in a particular order, or give them all the same priority and process them at one time.

1 Like

Hmm, yes, currently I am filtering out the unnecessary (to our subscriber) based on the namespace.
Option 2 is what I had in mind, but its kind of late to implement that :smile: , so was hoping if there was some setting in confd which would do that ‘magic’ for us.


There is no magic setting that I am aware of for subscribers. There is a way to control which models are exposed through the northbound interfaces, but there is nothing like that for the CDB subscriber. You either get everything as you currently are, or you have to selectively subscribe for just what you want.

1 Like