Skip to content

Are there an examples of how to use this API for NETCONF subscriptions/events? #32

Open

Description

@senderic

I am looking to use the Netconf client to subscribe to an event. Basically, whenever a field changes in my sysrepo netconf server, I need my client to know about it. I know there is a spec for this:

https://tools.ietf.org/id/draft-ietf-netconf-netconf-event-notifications-05.html

I am wondering if this Netconf-Java API has that ability to subscribe and if there are examples of it? (I am researching it as I write this, but wanted to throw that question out there just in case).

If this ability is not part of netconf-java, what I may do is just create a loop that simply polls the netconf server every N seconds for updates to the wanted field in sysrepo. Would you consider using the same technique?

Activity

  1. peterjhill commented on May 29, 2020

    @peterjhill
    Contributor

    afaik, I don't think so. We have a poller that queries a db to see if we need to sync a change to our routers. If so, we then make the change.

    We use this library to communicate with the router, but put all the logic of what it should do into our own code.

    I guess you could map our control plane components to the app and sysrepo engine in the diagram on this page: http://www.sysrepo.org/Sysrepo

    That draft rfc has a date of 2017. I don't recall any PRs to add that functionality. I could be wrong. (I could also be answering something completely different than what your are asking.

    Hope you are well! Have a good weekend.

  2. ydnath commented on Jun 4, 2020

    @ydnath
    Member

    This library does not support NETCONF notifications as yet.

    IMO, Polling is not a good technique in this case. Ideal approach would be to add a publish-subscribe mechanism.

  3. murthy-nn commented on Jun 30, 2021

    @murthy-nn

    afaik, I don't think so. We have a poller that queries a db to see if we need to sync a change to our routers. If so, we then make the change.

    We use this library to communicate with the router, but put all the logic of what it should do into our own code.

    I guess you could map our control plane components to the app and sysrepo engine in the diagram on this page: http://www.sysrepo.org/Sysrepo

    That draft rfc has a date of 2017. I don't recall any PRs to add that functionality. I could be wrong. (I could also be answering something completely different than what your are asking.

    Hope you are well! Have a good weekend.

    http://www.sysrepo.org

    Hello Peter,

    Thanks for the response. Please clarify the following queries.

    Are you referring to a poller library that is part of the device?

    Are you suggesting implementing Netconf notification handling in NMS following the design of this poller?

  4. peterjhill commented on Jul 22, 2021

    @peterjhill
    Contributor

    My use case is pushing config down to routers using netconf. The authoritative state of the device is stored in a database. We take info in the database to craft the router config and push it all down to the router. Load override style. So we don't poll any events on the router and then trigger netconf.

    So I may not be the best person to answer the question, as it seems it is more about events on the router triggering netconf to do something?

  5. peterjhill commented on Jun 17, 2025

    @peterjhill
    Contributor

    I don't think I would combine this libary and something that talks to a DB to trigger changes. That feels like another component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions