Open APIs

 View Only
  • 1.  TMF 641 - Notification listener (client side) APIs

    Posted Apr 20, 2022 09:35

    I am pretty new with the APIs.

    While implementing notification listener (client side) APIs I have observed that 201 response payload always have a "callback" attribute.

    I am just curious to know what is the purpose of this "callback" ?

    From the swagger I could see it mentions, callback is to register, what kind of this registration is ?

    EventSubscription {

    description:

    Sets the communication endpoint address the service instance must use to deliver notification information

    id*

    string

    Id of the listener

    callback*

    string

    The callback being registered.

    query

    string

    additional data to be passed

    }



    ------------------------------
    Shabad Mathur
    Zensar Technologies
    ------------------------------


  • 2.  RE: TMF 641 - Notification listener (client side) APIs

    TM Forum Member
    Posted Apr 21, 2022 01:30
    Edited by G B Aswath Apr 21, 2022 01:33
    The callback is a URL of client which is used by server / sender to push notifications to its registered consumers / clients. TMF 641 supports following notifications

    • OrderCreationNotification
    • OrderRemoveNotification
    • OrderStateChangeNotification
    • OrderValueChangeNotification
    • OrderInformationRequiredNotification

    Consumer /Client can registered for any / all of the above notifications which can be supplied in query parameter along with URL to which server should post this notifications should be given in callback during above event registration process.

    ------------------------------
    G B Aswath
    NMSWorks Software Pvt. Ltd.
    ------------------------------



  • 3.  RE: TMF 641 - Notification listener (client side) APIs

    TM Forum Member
    Posted 29 days ago
    Hi all
    Please note that the hub pattern is entrenched in (almost) all the TMF Open APIs, and is described in the Design Guidelines TMF630.
    The hub pattern allows consumers of API operations to register to receive events that occur as a result of operation invocation, for example entity created, entity deleted, state changed, etc., as in the TMF641 example quoted above by GB Aswath.
    The hub pattern is inherently point-to-point. An alternative is to use true eventing, abstracted by the Event Management API TMF688.

    ------------------------------
    Jonathan Goldberg
    Amdocs Management Limited
    Any opinions and statements made by me on this forum are purely personal, and do not necessarily reflect the position of the TM Forum or my employer.
    ------------------------------



  • 4.  RE: TMF 641 - Notification listener (client side) APIs

    Posted 22 days ago
    Thanks a lot Jonathan & GB Aswath for your reply.
    However, I have one more related query:

    Inside all the skeleton codebase for listener APIs provided in "NotificationListenerClientSideService.js", I observe following two consecutive statements are prominent in all methods :

    1. sendDoc(res, 201, payload);
    2. notificationUtils.publish(req,payload);

    Inside publish (req, payload) method following methods are called :

    1. createEventMessage(resourceType, method, doc, old);
    2. notify(db, clients, message);

    And inside notify(db, clients, message); method, processMessage(db, client, message) is called.

    Could you please help me in understanding the significance of calling notificationUtils.publish() method just after calling sendDoc() method ?



    ------------------------------
    Shabad Mathur
    Zensar Technologies
    ------------------------------



  • 5.  RE: TMF 641 - Notification listener (client side) APIs

    TM Forum Member
    Posted 22 days ago
    Hi
    It looks like this is code in the reference implementation (RI) of the API. I'm afraid I have no idea what the business logic in TMF Open APIs RI is. Perhaps @Victor Mari can assist.​

    ------------------------------
    Jonathan Goldberg
    Amdocs Management Limited
    Any opinions and statements made by me on this forum are purely personal, and do not necessarily reflect the position of the TM Forum or my employer.
    ------------------------------



  • 6.  RE: TMF 641 - Notification listener (client side) APIs

    TM Forum Member
    Posted 22 days ago
    Hi @Shabad Mathur,

    In short, the purpose of the sendDoc​ function is to clean up the payload and return it on the Http response. The payload also gets published to the hub so it can be queried on the other Hub endpoints.

    Calling the methods in that order is purely technical since the sendDoc mutates the object and the publish method will use the same object as it was returned on the request.

    Let me know if you have more questions.

    ------------------------------
    Victor Rodriguez
    TM Forum
    ------------------------------