Aggregating notifications for multiple subscriber through MQTT

Viewed 171

My use case is the following: I have hundreds (if not thousands) of AE that are subscribed to 1 other AE that publish sensor data on a container. Each of these AE has the same POA. The issue is that for each sensor data, the same notification is sent in MQTT only to one subscriber: 1 new CIN triggers 1000 Notifications. Is it possible in the oneM2M spec to aggregate all those notifications as one, and for each subscribed AE to listen to the same topic and receive the same notification ?

It looks like groups and "notificationForwardingURI" may be what I'm looking for; but after reading TS0001 10.2.7.11 and 10.2.7.12; and table 9.6.8-2 I am not sure that it answer my issue.

2 Answers

It sounds to me that the <subscription> resource may not be setup to do what you are attempting.

If you want to send the notification to multiple AE's, that should be configured by specifying the notificationURIs with the AE-ID of each receiver. From what you have described, it sounds like their is only 1 AE specified in the notificationURIs.

So if you have 1000 notificationURIs then there will be 1000 notifications.

If I understand what you are attempting to do, you want a single notification to be delivered using the MQTT message delivery mechanism. That is possible, but not defined in oneM2M. The oneM2M MQTT bindings are intended to create a one-to-one message flow between the CSE and the AE. You are trying to use MQTT in its intended method of 1 to many. So while not defined by oneM2M, this can be done in the following manner. 1) create 1 AE (notification receiver)
2) create a <subscription> with the notificationURI set to the AE.

Externally have all of your other listeners subscribe to the MQTT topic of the AE. Ensure that only 1 AE responds to the notification request.

Using the notificationForwardingURI attribute might be the right way to implement your scenario. You also want to check TS-0001 (Functional Architecture), section "10.2.7.10 Subscribe and Un-Subscribe of a group" and TS-0004 (Service Layer Core Protocol Specification), section "7.4.14.2.3 Assign URI for aggregation of notification" and the following sections.

Also check in TS-0010 (MQTT Protocol Binding), section "6.6 URI format" for the format of the notification URI for MQTT.

Related