QoS 1 and persistent sessions on network server

Hello, I am considering using persistent session and QoS 1 on loraserver’s network server (NS). Reason is ability to store gateway messages while NS is down. One thing that prevents this is that during clean shutdown NS sends unsubscribe requests. Can this be turned off? More strange issue is that the offline messages seem not to be processed in NS once it is up.
Test scenario:
setup qos, clean_session=false on NS
kill NS
publish invalid message into gateway/foo/rx
start NS

In wireshark I see the message is sent to NS and NS sends back puback for this invalid message, however I fail to see the message as error in log. Is the message silently discarded if it was received during startup (before NS sends subscribe requests) ? Is it a good idea in general to cache gateway messages this way?

bumping this question…

To answer my own questions, unsubscribe can be removed in backend.go lines 137-148, adding a handler for messages that arrive before subscribe can be done before line 118, code:

b.conn.AddRoute(b.config.UplinkTopicTemplate, b.rxPacketHandler)
b.conn.AddRoute(b.config.StatsTopicTemplate, b.statsPacketHandler)
b.conn.AddRoute(b.config.AckTopicTemplate, b.ackPacketHandler)

Is there an interest to integrate any of this?

1 Like