I want to send some specific type of messages to a channel that should not remain stored for more than 5 minutes where as rest of the messages should be remained stored for the maximum supported time. Is there any way to achieve that e.g. by doing ttl = 300000;// ms publish(channel_name, msg, ttl ) // this msg with die in 5 minutes;
Is it possible to achieve that? If not, then as an alternative is it possible to create a channel that stores every msg for 5 minutes.
Hi Guarav, this isn't currently supported though our product team has been informed of your request to specify storage TTL per publish.
As Dannel stated, we don't have a per channel TTL. Every channel has the same storage duration that is configured in your PubNub Account Dashboard. You can publish with doNotStore flag set to true to not store it at all and pull the message from the channel message cache queue but that cache is not predictable. It can remain cache from 5 to 20 minutes and if there are lots of messages it can get pushed off the size 100 message queue.
Best alternative is:
Hope that is helpful.