{"action":"created","issue":{"url":"https://api.github.com/repos/erlio/vernemq/issues/71","labels_url":"https://api.github.com/repos/erlio/vernemq/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/erlio/vernemq/issues/71/comments","events_url":"https://api.github.com/repos/erlio/vernemq/issues/71/events","html_url":"https://github.com/erlio/vernemq/issues/71","id":116627818,"number":71,"title":"Replication of subscriptions","user":{"login":"testark","id":15380492,"avatar_url":"https://avatars.githubusercontent.com/u/15380492?v=3","gravatar_id":"","url":"https://api.github.com/users/testark","html_url":"https://github.com/testark","followers_url":"https://api.github.com/users/testark/followers","following_url":"https://api.github.com/users/testark/following{/other_user}","gists_url":"https://api.github.com/users/testark/gists{/gist_id}","starred_url":"https://api.github.com/users/testark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/testark/subscriptions","organizations_url":"https://api.github.com/users/testark/orgs","repos_url":"https://api.github.com/users/testark/repos","events_url":"https://api.github.com/users/testark/events{/privacy}","received_events_url":"https://api.github.com/users/testark/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-11-12T19:56:28Z","updated_at":"2015-11-13T15:38:45Z","closed_at":null,"body":"(This is somehow related to #70, so I've reopened it.)\r\n\r\nI have a cluster with two nodes, and I'm trying to \"manually\" subscribe clients to topics using `vmq_reg:subscribe` as described in #70.\r\n\r\nHowever, I am noticing that if I issue the `vmq_reg:subscribe/4` command (either from the console or a plugin) in a node different from the node the client has last been connected to, the subscription won't take effect and no offline messages will be stored. Here's a picture for a better understanding:\r\n\r\n![vernemq-71-1](https://cloud.githubusercontent.com/assets/15380492/11129467/59f55bae-8977-11e5-9010-65dbcc5a1064.png)\r\n\r\nIf, however, the subscription is directed to the last node the client was connected to, everything goes smoothly:\r\n\r\n![vernemq-71-2](https://cloud.githubusercontent.com/assets/15380492/11144854/cd43b68e-89f7-11e5-93cc-c8cb9e54c006.png)\r\n"},"comment":{"url":"https://api.github.com/repos/erlio/vernemq/issues/comments/156466404","html_url":"https://github.com/erlio/vernemq/issues/71#issuecomment-156466404","issue_url":"https://api.github.com/repos/erlio/vernemq/issues/71","id":156466404,"user":{"login":"testark","id":15380492,"avatar_url":"https://avatars.githubusercontent.com/u/15380492?v=3","gravatar_id":"","url":"https://api.github.com/users/testark","html_url":"https://github.com/testark","followers_url":"https://api.github.com/users/testark/followers","following_url":"https://api.github.com/users/testark/following{/other_user}","gists_url":"https://api.github.com/users/testark/gists{/gist_id}","starred_url":"https://api.github.com/users/testark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/testark/subscriptions","organizations_url":"https://api.github.com/users/testark/orgs","repos_url":"https://api.github.com/users/testark/repos","events_url":"https://api.github.com/users/testark/events{/privacy}","received_events_url":"https://api.github.com/users/testark/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T15:38:45Z","updated_at":"2015-11-13T15:38:45Z","body":"@ioolkos My current workaround is to use a `gen_server` in the plugin and use `gen_server:multicall/3` to the result of `vmq_cluster:nodes()`. Then, in the `handle_call` callback I use `vmq_reg:status` to check if the client has a queue in the current node and, in case it does, do the subscription (ignoring the request otherwise). Do you think this is a good idea? "}}