- I have build an application which uses the pubnub go library. It subscribes to n number of pubnub channels on its start-up.
- The listener for which the messages come consistently(atleast a couple of times in a day) it doesn't stops listening.
- The listener for which the messages don't come consistently(one case I found was where there was no message send on the channel for 5 days) it stops listening to the messages.
- It seems like if the listener is in idle state for a certain amount of time it stops listening to the channel.
Solution that I came up with:-
- Run a cron job which checks for the last message received from the pubnub historical message and the last message that was processed by the pubnub listener handler.
- It they differ then resubscribe.
Solution that I came up with:-