openBackhaul / NotificationProxy

Consolidates notifications into specific streams
Apache License 2.0
1 stars 1 forks source link

v1.0.1_test-2: Notification streaming is stopped when controller rebooted, NP is not aware of notification streaming is not active #72

Open Ziabatcha opened 8 months ago

Ziabatcha commented 8 months ago

With v1.0.1_test-2, Unable to see Notifications in NP docker logs Have enabled to Listen to controller API and able to see the following prints.

But when Alarms are raised , Attribute changes are done , Obhect created ot deleted. We are unable to see the notification prints in Docker logs.

Docker prints:

ease-number":"1.0.1","operation-name":"/v1/listen-to-controllers","response-code":204}response code:204 [05:35:07.825] WARN (1): controller stream for OpenDayLight1 already active [05:35:07.825] WARN (1): controller stream for OpenDayLight1 already active [05:35:07.825] WARN (1): device stream for OpenDayLight1 already active POST /v1/notify-device-alarms 204 253.607 ms - -

callback : POST http://xxx:xxx/v1/record-service

[05:35:35.620] INFO (1): Active subscribers: [05:35:35.622] INFO (1): /v1/notify-controller-attribute-value-changes -> MicroWaveDeviceInventory/1.1.1, [05:35:35.624] INFO (1): /v1/notify-controller-object-creations -> [05:35:35.625] INFO (1): /v1/notify-controller-object-deletions -> [05:35:35.627] INFO (1): /v1/notify-device-alarms -> MicroWaveDeviceInventory/1.1.1, [05:35:35.630] INFO (1): /v1/notify-device-attribute-value-changes -> MicroWaveDeviceInventory/1.1.1, [05:35:35.633] INFO (1): /v1/notify-device-object-creations -> MicroWaveDeviceInventory/1.1.1, [05:35:35.637] INFO (1): /v1/notify-device-object-deletions -> MicroWaveDeviceInventory/1.1.1, POST /v1/remove-controller 204 269.635 ms - -

paulBMentopolis commented 7 months ago

This issue most likely concerns the handling of a non-reachable controller (reconnection of np-streams to controller). Closed issues which reference this known issue: https://github.com/openBackhaul/NotificationProxy/issues/46 https://github.com/openBackhaul/NotificationProxy/issues/28

The problem most likely is not seated in the NotificationProxy but on the Controller (SSE-Server), because the SSE-Client (in NP) should never receive a 404 code which leads to permanent closing of stream. The only valid http codes for SSE are 301, 307, 200 and 204. This may be a configuration issue on the controller. Reference: https://javascript.info/server-sent-events#reconnection