{"action":"created","issue":{"url":"https://api.github.com/repos/emqtt/emqttd/issues/448","repository_url":"https://api.github.com/repos/emqtt/emqttd","labels_url":"https://api.github.com/repos/emqtt/emqttd/issues/448/labels{/name}","comments_url":"https://api.github.com/repos/emqtt/emqttd/issues/448/comments","events_url":"https://api.github.com/repos/emqtt/emqttd/issues/448/events","html_url":"https://github.com/emqtt/emqttd/issues/448","id":131891552,"number":448,"title":"How to persist subscriptions after broker restart","user":{"login":"87sanchavan","id":589606,"avatar_url":"https://avatars.githubusercontent.com/u/589606?v=3","gravatar_id":"","url":"https://api.github.com/users/87sanchavan","html_url":"https://github.com/87sanchavan","followers_url":"https://api.github.com/users/87sanchavan/followers","following_url":"https://api.github.com/users/87sanchavan/following{/other_user}","gists_url":"https://api.github.com/users/87sanchavan/gists{/gist_id}","starred_url":"https://api.github.com/users/87sanchavan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/87sanchavan/subscriptions","organizations_url":"https://api.github.com/users/87sanchavan/orgs","repos_url":"https://api.github.com/users/87sanchavan/repos","events_url":"https://api.github.com/users/87sanchavan/events{/privacy}","received_events_url":"https://api.github.com/users/87sanchavan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-06T19:38:17Z","updated_at":"2016-02-08T01:37:53Z","closed_at":null,"body":"Hi \r\n\r\nI am running emqttd with default options. However when I restart broker , it looses all existing subscriptions. I was looking into emqttd.config file and made one change to see if that work ..\r\n\r\n{pubsub, [\r\n            %% Default should be scheduler numbers\r\n            {pool_size, 8},\r\n\r\n            %% Subscription: disc | ram | false\r\n           %% {subscription, ram},\r\n            {subscription, disc},\r\n\r\n----------------------------------------------------------\r\nI commented ram and added disc option as I thought subscriptions will be stored on disc however it didnt work.\r\n\r\nThanks\r\nSanjay"},"comment":{"url":"https://api.github.com/repos/emqtt/emqttd/issues/comments/181155020","html_url":"https://github.com/emqtt/emqttd/issues/448#issuecomment-181155020","issue_url":"https://api.github.com/repos/emqtt/emqttd/issues/448","id":181155020,"user":{"login":"erylee","id":11869,"avatar_url":"https://avatars.githubusercontent.com/u/11869?v=3","gravatar_id":"","url":"https://api.github.com/users/erylee","html_url":"https://github.com/erylee","followers_url":"https://api.github.com/users/erylee/followers","following_url":"https://api.github.com/users/erylee/following{/other_user}","gists_url":"https://api.github.com/users/erylee/gists{/gist_id}","starred_url":"https://api.github.com/users/erylee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erylee/subscriptions","organizations_url":"https://api.github.com/users/erylee/orgs","repos_url":"https://api.github.com/users/erylee/repos","events_url":"https://api.github.com/users/erylee/events{/privacy}","received_events_url":"https://api.github.com/users/erylee/received_events","type":"User","site_admin":false},"created_at":"2016-02-08T01:37:53Z","updated_at":"2016-02-08T01:37:53Z","body":"@87sanchavan, please load the 'subscription' module:\r\n\r\n```\r\n    %% Modules\r\n    {modules, [\r\n        ......\r\n        %% Subscribe topics automatically when client connected\r\n        {subscription, [\r\n            %% Subscription from stored table\r\n            stored,\r\n\r\n            %% $u will be replaced with username\r\n            {\"$Q/username/$u\", 1},\r\n\r\n            %% $c will be replaced with clientid\r\n            {\"$Q/client/$c\", 1}\r\n        ]}\r\n        ......\r\n```"}}