onem2m

ExpirationCounter in subscription resource


There is an attribute called expirationCounter in subscription resource with following details in TS-0001: "This attribute (notification policy) indicates that the subscriber wants to set the life of this subscription to a limit of a maximum number of notifications. When the number of notifications sent reaches the count of this counter, the subscription resource shall be deleted, regardless of any other policy."

Should expirationCounter be decreased by the count equal to number of notificationURI present in a subscription and when notification is successfully received by the receiver?

For example: a has 4 notificationURI and expirationCounter set to 100. when an event occurs, notification is successfully received by 2 URI while 2 notificationURI couldn't be reached.

What will be the value of expirationCounter in this case?


Solution

  • In TS-0001, section 10.2.10.7 „Notification message handling procedure“ the procedure is described in detail. Here it says

    The expirationCounter shall be decreased by one when the Hosting CSE successfully sends the notification request to Receiver(s). If the counter reaches zero, the corresponding subscription resource shall be deleted.

    This means that the expirationCounter is decreased by one for each notification event and when it could successfully send the requests, not for each request it sends to one or more receivers. It is independent from the number of URI in notificationURI.

    For example, when a subscription‘s expirationCounter is set to 10, then the subscription is removed after the 10th time it is triggered (assuming the requests could be successfully sent).