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 :
- sendDoc(res, 201, payload);
- notificationUtils.publish(req,payload);
Inside publish (req, payload) method following methods are called :
- createEventMessage(resourceType, method, doc, old);
- 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
------------------------------
Original Message:
Sent: Apr 24, 2022 07:08
From: Jonathan Goldberg
Subject: TMF 641 - Notification listener (client side) APIs
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.
Original Message:
Sent: Apr 21, 2022 01:30
From: G B Aswath
Subject: TMF 641 - Notification listener (client side) APIs
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.
Original Message:
Sent: Apr 19, 2022 11:11
From: Shabad Mathur
Subject: TMF 641 - Notification listener (client side) APIs
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
------------------------------