{"action":"created","comment":{"url":"https://api.github.com/repos/ably/ably-java/pulls/comments/52732679","id":52732679,"diff_hunk":"@@ -50,6 +51,7 @@ public AblyRealtime(ClientOptions options) throws AblyException {\n \t\tsuper(options);\n \t\tchannels = new Channels();\n \t\tconnection = new Connection(this);\n+\t\thttp.setHost(options.realtimeHost);","path":"lib/src/main/java/io/ably/lib/realtime/AblyRealtime.java","position":12,"original_position":12,"commit_id":"8ea2714cdc3040e4606f2320c0c60b8f254ba15c","original_commit_id":"9e07f45f5dafbf676e2d93f3d912792437e0513c","user":{"login":"mattheworiordan","id":43789,"avatar_url":"https://avatars.githubusercontent.com/u/43789?v=3","gravatar_id":"","url":"https://api.github.com/users/mattheworiordan","html_url":"https://github.com/mattheworiordan","followers_url":"https://api.github.com/users/mattheworiordan/followers","following_url":"https://api.github.com/users/mattheworiordan/following{/other_user}","gists_url":"https://api.github.com/users/mattheworiordan/gists{/gist_id}","starred_url":"https://api.github.com/users/mattheworiordan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattheworiordan/subscriptions","organizations_url":"https://api.github.com/users/mattheworiordan/orgs","repos_url":"https://api.github.com/users/mattheworiordan/repos","events_url":"https://api.github.com/users/mattheworiordan/events{/privacy}","received_events_url":"https://api.github.com/users/mattheworiordan/received_events","type":"User","site_admin":false},"body":"I see two problems with this approach:\r\n\r\n1. You are setting the REST Host to the RealtimeHost in all situations. This is wrong, we only use the fallback host for REST requests when the realtime host is using that fallback host.\r\n2. If a realtime request falls back to a fallback host, but then later resumes using the default realtime host, all future REST requests will continue to go to the incorrect fallback host, see https://github.com/ably/ably-java/pull/80/files#diff-060685a947a7032665de7ac9d33bb6ffR588","created_at":"2016-02-12T11:51:12Z","updated_at":"2016-02-12T11:51:12Z","html_url":"https://github.com/ably/ably-java/pull/80#discussion_r52732679","pull_request_url":"https://api.github.com/repos/ably/ably-java/pulls/80","_links":{"self":{"href":"https://api.github.com/repos/ably/ably-java/pulls/comments/52732679"},"html":{"href":"https://github.com/ably/ably-java/pull/80#discussion_r52732679"},"pull_request":{"href":"https://api.github.com/repos/ably/ably-java/pulls/80"}}},"pull_request":{"url":"https://api.github.com/repos/ably/ably-java/pulls/80","id":57637903,"html_url":"https://github.com/ably/ably-java/pull/80","diff_url":"https://github.com/ably/ably-java/pull/80.diff","patch_url":"https://github.com/ably/ably-java/pull/80.patch","issue_url":"https://api.github.com/repos/ably/ably-java/issues/80","number":80,"state":"open","locked":false,"title":"Add httpMaxRetryCount && Simplify http fallback flow","user":{"login":"gokhanbarisaker","id":914990,"avatar_url":"https://avatars.githubusercontent.com/u/914990?v=3","gravatar_id":"","url":"https://api.github.com/users/gokhanbarisaker","html_url":"https://github.com/gokhanbarisaker","followers_url":"https://api.github.com/users/gokhanbarisaker/followers","following_url":"https://api.github.com/users/gokhanbarisaker/following{/other_user}","gists_url":"https://api.github.com/users/gokhanbarisaker/gists{/gist_id}","starred_url":"https://api.github.com/users/gokhanbarisaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gokhanbarisaker/subscriptions","organizations_url":"https://api.github.com/users/gokhanbarisaker/orgs","repos_url":"https://api.github.com/users/gokhanbarisaker/repos","events_url":"https://api.github.com/users/gokhanbarisaker/events{/privacy}","received_events_url":"https://api.github.com/users/gokhanbarisaker/received_events","type":"User","site_admin":false},"body":"Resolves: #54, #14","created_at":"2016-01-29T11:46:46Z","updated_at":"2016-02-12T11:51:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"269f75cfe6f53b21c6a16dcaf74c22a8c16a90ae","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ably/ably-java/pulls/80/commits","review_comments_url":"https://api.github.com/repos/ably/ably-java/pulls/80/comments","review_comment_url":"https://api.github.com/repos/ably/ably-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ably/ably-java/issues/80/comments","statuses_url":"https://api.github.com/repos/ably/ably-java/statuses/8ea2714cdc3040e4606f2320c0c60b8f254ba15c","head":{"label":"gokhanbarisaker:RSC15","ref":"RSC15","sha":"8ea2714cdc3040e4606f2320c0c60b8f254ba15c","user":{"login":"gokhanbarisaker","id":914990,"avatar_url":"https://avatars.githubusercontent.com/u/914990?v=3","gravatar_id":"","url":"https://api.github.com/users/gokhanbarisaker","html_url":"https://github.com/gokhanbarisaker","followers_url":"https://api.github.com/users/gokhanbarisaker/followers","following_url":"https://api.github.com/users/gokhanbarisaker/following{/other_user}","gists_url":"https://api.github.com/users/gokhanbarisaker/gists{/gist_id}","starred_url":"https://api.github.com/users/gokhanbarisaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gokhanbarisaker/subscriptions","organizations_url":"https://api.github.com/users/gokhanbarisaker/orgs","repos_url":"https://api.github.com/users/gokhanbarisaker/repos","events_url":"https://api.github.com/users/gokhanbarisaker/events{/privacy}","received_events_url":"https://api.github.com/users/gokhanbarisaker/received_events","type":"User","site_admin":false},"repo":{"id":47753381,"name":"ably-java","full_name":"gokhanbarisaker/ably-java","owner":{"login":"gokhanbarisaker","id":914990,"avatar_url":"https://avatars.githubusercontent.com/u/914990?v=3","gravatar_id":"","url":"https://api.github.com/users/gokhanbarisaker","html_url":"https://github.com/gokhanbarisaker","followers_url":"https://api.github.com/users/gokhanbarisaker/followers","following_url":"https://api.github.com/users/gokhanbarisaker/following{/other_user}","gists_url":"https://api.github.com/users/gokhanbarisaker/gists{/gist_id}","starred_url":"https://api.github.com/users/gokhanbarisaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gokhanbarisaker/subscriptions","organizations_url":"https://api.github.com/users/gokhanbarisaker/orgs","repos_url":"https://api.github.com/users/gokhanbarisaker/repos","events_url":"https://api.github.com/users/gokhanbarisaker/events{/privacy}","received_events_url":"https://api.github.com/users/gokhanbarisaker/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gokhanbarisaker/ably-java","description":"Java client for Ably real-time messaging service","fork":true,"url":"https://api.github.com/repos/gokhanbarisaker/ably-java","forks_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/forks","keys_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/teams","hooks_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/hooks","issue_events_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/issues/events{/number}","events_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/events","assignees_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/assignees{/user}","branches_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/branches{/branch}","tags_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/tags","blobs_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/statuses/{sha}","languages_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/languages","stargazers_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/stargazers","contributors_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/contributors","subscribers_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/subscribers","subscription_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/subscription","commits_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/contents/{+path}","compare_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/merges","archive_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/downloads","issues_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/issues{/number}","pulls_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/pulls{/number}","milestones_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/milestones{/number}","notifications_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/labels{/name}","releases_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/releases{/id}","deployments_url":"https://api.github.com/repos/gokhanbarisaker/ably-java/deployments","created_at":"2015-12-10T10:00:14Z","updated_at":"2016-01-12T19:32:12Z","pushed_at":"2016-02-12T06:15:39Z","git_url":"git://github.com/gokhanbarisaker/ably-java.git","ssh_url":"git@github.com:gokhanbarisaker/ably-java.git","clone_url":"https://github.com/gokhanbarisaker/ably-java.git","svn_url":"https://github.com/gokhanbarisaker/ably-java","homepage":null,"size":4780,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ably:master","ref":"master","sha":"3a97edbc922e5285dd2bbbc8cad5a4d5206ac88b","user":{"login":"ably","id":1859245,"avatar_url":"https://avatars.githubusercontent.com/u/1859245?v=3","gravatar_id":"","url":"https://api.github.com/users/ably","html_url":"https://github.com/ably","followers_url":"https://api.github.com/users/ably/followers","following_url":"https://api.github.com/users/ably/following{/other_user}","gists_url":"https://api.github.com/users/ably/gists{/gist_id}","starred_url":"https://api.github.com/users/ably/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ably/subscriptions","organizations_url":"https://api.github.com/users/ably/orgs","repos_url":"https://api.github.com/users/ably/repos","events_url":"https://api.github.com/users/ably/events{/privacy}","received_events_url":"https://api.github.com/users/ably/received_events","type":"Organization","site_admin":false},"repo":{"id":27377253,"name":"ably-java","full_name":"ably/ably-java","owner":{"login":"ably","id":1859245,"avatar_url":"https://avatars.githubusercontent.com/u/1859245?v=3","gravatar_id":"","url":"https://api.github.com/users/ably","html_url":"https://github.com/ably","followers_url":"https://api.github.com/users/ably/followers","following_url":"https://api.github.com/users/ably/following{/other_user}","gists_url":"https://api.github.com/users/ably/gists{/gist_id}","starred_url":"https://api.github.com/users/ably/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ably/subscriptions","organizations_url":"https://api.github.com/users/ably/orgs","repos_url":"https://api.github.com/users/ably/repos","events_url":"https://api.github.com/users/ably/events{/privacy}","received_events_url":"https://api.github.com/users/ably/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ably/ably-java","description":"Java client for Ably real-time messaging service","fork":false,"url":"https://api.github.com/repos/ably/ably-java","forks_url":"https://api.github.com/repos/ably/ably-java/forks","keys_url":"https://api.github.com/repos/ably/ably-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ably/ably-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ably/ably-java/teams","hooks_url":"https://api.github.com/repos/ably/ably-java/hooks","issue_events_url":"https://api.github.com/repos/ably/ably-java/issues/events{/number}","events_url":"https://api.github.com/repos/ably/ably-java/events","assignees_url":"https://api.github.com/repos/ably/ably-java/assignees{/user}","branches_url":"https://api.github.com/repos/ably/ably-java/branches{/branch}","tags_url":"https://api.github.com/repos/ably/ably-java/tags","blobs_url":"https://api.github.com/repos/ably/ably-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ably/ably-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ably/ably-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/ably/ably-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ably/ably-java/statuses/{sha}","languages_url":"https://api.github.com/repos/ably/ably-java/languages","stargazers_url":"https://api.github.com/repos/ably/ably-java/stargazers","contributors_url":"https://api.github.com/repos/ably/ably-java/contributors","subscribers_url":"https://api.github.com/repos/ably/ably-java/subscribers","subscription_url":"https://api.github.com/repos/ably/ably-java/subscription","commits_url":"https://api.github.com/repos/ably/ably-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/ably/ably-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/ably/ably-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/ably/ably-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/ably/ably-java/contents/{+path}","compare_url":"https://api.github.com/repos/ably/ably-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ably/ably-java/merges","archive_url":"https://api.github.com/repos/ably/ably-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ably/ably-java/downloads","issues_url":"https://api.github.com/repos/ably/ably-java/issues{/number}","pulls_url":"https://api.github.com/repos/ably/ably-java/pulls{/number}","milestones_url":"https://api.github.com/repos/ably/ably-java/milestones{/number}","notifications_url":"https://api.github.com/repos/ably/ably-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ably/ably-java/labels{/name}","releases_url":"https://api.github.com/repos/ably/ably-java/releases{/id}","deployments_url":"https://api.github.com/repos/ably/ably-java/deployments","created_at":"2014-12-01T11:54:06Z","updated_at":"2016-01-14T07:32:18Z","pushed_at":"2016-02-12T06:15:39Z","git_url":"git://github.com/ably/ably-java.git","ssh_url":"git@github.com:ably/ably-java.git","clone_url":"https://github.com/ably/ably-java.git","svn_url":"https://github.com/ably/ably-java","homepage":null,"size":4820,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":41,"forks":10,"open_issues":41,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ably/ably-java/pulls/80"},"html":{"href":"https://github.com/ably/ably-java/pull/80"},"issue":{"href":"https://api.github.com/repos/ably/ably-java/issues/80"},"comments":{"href":"https://api.github.com/repos/ably/ably-java/issues/80/comments"},"review_comments":{"href":"https://api.github.com/repos/ably/ably-java/pulls/80/comments"},"review_comment":{"href":"https://api.github.com/repos/ably/ably-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ably/ably-java/pulls/80/commits"},"statuses":{"href":"https://api.github.com/repos/ably/ably-java/statuses/8ea2714cdc3040e4606f2320c0c60b8f254ba15c"}}}}