Periodic re-subscribe?

Hopefully this is an easy answer. Roughly every 5 hours, my bridge unsubscribes to the command topic, then immediately resubscribes.

Searching other posts, I see that it will do this if it hasn’t heard from the network server for awhile. The server broker is running on the same box, and logs do not show the broker going down at any time nor any connection problems from my other mqtt client.

Is this a problem?

INFO[42823] integration/mqtt: publishing event event=stats qos=0 topic=gateway/00800000a000387a/event/stats
INFO[42840] integration/mqtt: unsubscribe topic topic=“gateway/00800000a000387a/command/#”
INFO[42840] integration/mqtt: subscribing to topic qos=0 topic=“gateway/00800000a000387a/command/#”
INFO[42883] integration/mqtt: publishing event event=stats qos=0 topic=gateway/00800000a000387a/event/stats

thanks,
Curt

I wouldn’t call it a problem at ~5 hours, but you could certainly look into the keep-alive situation on each end of your connection and decide if they’re where you want them. Also keep in mind that a lot of firewalls will enforce TCP timeouts that end up being fairly low for long-lived connections like MQTT. (I recently found one Amazon ELB that was kill connections every 60 seconds for a client that wasn’t sending keep-alives.)

If the MQTT/TCP connection was lost, would I not see a message in the logs before it does the unsub/resub? I tried again with log-level = 5 to see if I get some more info on the events that cause it, nothing much:

DEBU[0419] backend/semtechudp: received udp packet from gateway  addr="127.0.0.1:52866" protocol_version=2 type=PushData
INFO[0419] integration/mqtt: publishing event            event=stats qos=0 topic=gateway/00800000a000387a/event/stats
DEBU[0419] backend/semtechudp: sending udp packet to gateway  addr="127.0.0.1:52866" protocol_version=2 type=PushACK
DEBU[0420] backend/semtechudp: cleanup gateway registry
INFO[0420] integration/mqtt: unsubscribe topic           topic="gateway/00800000a000387a/command/#"
DEBU[0420] backend/semtechudp: received udp packet from gateway  addr="127.0.0.1:46696" protocol_version=2 type=PullData
DEBU[0420] backend/semtechudp: sending udp packet to gateway  addr="127.0.0.1:46696" protocol_version=2 type=PullACK
INFO[0420] integration/mqtt: subscribing to topic        qos=0 topic="gateway/00800000a000387a/command/#"

Looking at the code, doesn’t look like it prints if connection was lost (unless I missed it?)

OK, will probably just live with the disconnect until a network expert can look into the disconnection reasons (mqtt or tcp keepalive?)