{"action":"created","comment":{"url":"https://api.github.com/repos/oneops/antenna/pulls/comments/85397185","pull_request_review_id":6117171,"id":85397185,"diff_hunk":"@@ -74,49 +77,40 @@ public void init() {\n      */\n     @Override\n     public boolean postMessage(NotificationMessage msg, BasicSubscriber sub) {\n+        URLSubscriber urlSub = (URLSubscriber) sub;\n+        boolean isHpom = urlSub.hasHpomXfmr();\n \n-        boolean isHpom = false;\n-        try {\n-            URLSubscriber urlSub = (URLSubscriber) sub;\n-            isHpom = urlSub.hasHpomXfmr();\n+        CloseableHttpClient httpClient = HttpClients.createDefault();\n \n-            DefaultHttpClient httpClient = new DefaultHttpClient();\n-            if (urlSub.getUserName() != null) {\n-                BasicCredentialsProvider cp = new BasicCredentialsProvider();\n-                cp.setCredentials(AuthScope.ANY,\n-                        new UsernamePasswordCredentials(urlSub.getUserName(),\n-                                urlSub.getPassword()));\n-                httpClient.setCredentialsProvider(cp);\n-            }\n+        HttpPost req = new HttpPost(urlSub.getUrl());\n+        req.setEntity(new StringEntity(gson.toJson(msg), ContentType.APPLICATION_JSON));\n \n-            HttpComponentsClientHttpRequestFactory rf = new HttpComponentsClientHttpRequestFactory(httpClient);\n-            rf.setReadTimeout(2000);\n-            if (urlSub.getTimeout() > 0) {\n-                rf.setConnectTimeout(urlSub.getTimeout());\n-            } else {\n-                rf.setConnectTimeout(2000);\n-            }\n+        int timeout = urlSub.getTimeout();\n+        req.setConfig(RequestConfig.custom().setSocketTimeout(timeout > 0 ? timeout : 2000).build());","path":"src/main/java/com/oneops/antenna/senders/generic/HTTPMsgService.java","position":102,"original_position":102,"commit_id":"6ea18987f1c158c64f895ec04d344757a4ca9c94","original_commit_id":"6ea18987f1c158c64f895ec04d344757a4ca9c94","user":{"login":"sureshg","id":356994,"avatar_url":"https://avatars.githubusercontent.com/u/356994?v=3","gravatar_id":"","url":"https://api.github.com/users/sureshg","html_url":"https://github.com/sureshg","followers_url":"https://api.github.com/users/sureshg/followers","following_url":"https://api.github.com/users/sureshg/following{/other_user}","gists_url":"https://api.github.com/users/sureshg/gists{/gist_id}","starred_url":"https://api.github.com/users/sureshg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sureshg/subscriptions","organizations_url":"https://api.github.com/users/sureshg/orgs","repos_url":"https://api.github.com/users/sureshg/repos","events_url":"https://api.github.com/users/sureshg/events{/privacy}","received_events_url":"https://api.github.com/users/sureshg/received_events","type":"User","site_admin":false},"body":"@lkhusid does this handle both the connection and the read timeout? So basically, it should timeout a request to bad (down) and unresponsive server (taking long time to respond).","created_at":"2016-10-27T18:20:21Z","updated_at":"2016-10-27T18:21:15Z","html_url":"https://github.com/oneops/antenna/pull/19#discussion_r85397185","pull_request_url":"https://api.github.com/repos/oneops/antenna/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/oneops/antenna/pulls/comments/85397185"},"html":{"href":"https://github.com/oneops/antenna/pull/19#discussion_r85397185"},"pull_request":{"href":"https://api.github.com/repos/oneops/antenna/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/oneops/antenna/pulls/19","id":91124187,"html_url":"https://github.com/oneops/antenna/pull/19","diff_url":"https://github.com/oneops/antenna/pull/19.diff","patch_url":"https://github.com/oneops/antenna/pull/19.patch","issue_url":"https://api.github.com/repos/oneops/antenna/issues/19","number":19,"state":"open","locked":false,"title":"Forced preemptive authorization for basic auth.   Simplified and clea…","user":{"login":"lkhusid","id":716542,"avatar_url":"https://avatars.githubusercontent.com/u/716542?v=3","gravatar_id":"","url":"https://api.github.com/users/lkhusid","html_url":"https://github.com/lkhusid","followers_url":"https://api.github.com/users/lkhusid/followers","following_url":"https://api.github.com/users/lkhusid/following{/other_user}","gists_url":"https://api.github.com/users/lkhusid/gists{/gist_id}","starred_url":"https://api.github.com/users/lkhusid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lkhusid/subscriptions","organizations_url":"https://api.github.com/users/lkhusid/orgs","repos_url":"https://api.github.com/users/lkhusid/repos","events_url":"https://api.github.com/users/lkhusid/events{/privacy}","received_events_url":"https://api.github.com/users/lkhusid/received_events","type":"User","site_admin":false},"body":"…ned up code to move on from deprecated api.","created_at":"2016-10-27T02:44:12Z","updated_at":"2016-10-27T18:21:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"423f107170259641d798a9cdf71e67e400d7505d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/oneops/antenna/pulls/19/commits","review_comments_url":"https://api.github.com/repos/oneops/antenna/pulls/19/comments","review_comment_url":"https://api.github.com/repos/oneops/antenna/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oneops/antenna/issues/19/comments","statuses_url":"https://api.github.com/repos/oneops/antenna/statuses/6ea18987f1c158c64f895ec04d344757a4ca9c94","head":{"label":"lkhusid:master","ref":"master","sha":"6ea18987f1c158c64f895ec04d344757a4ca9c94","user":{"login":"lkhusid","id":716542,"avatar_url":"https://avatars.githubusercontent.com/u/716542?v=3","gravatar_id":"","url":"https://api.github.com/users/lkhusid","html_url":"https://github.com/lkhusid","followers_url":"https://api.github.com/users/lkhusid/followers","following_url":"https://api.github.com/users/lkhusid/following{/other_user}","gists_url":"https://api.github.com/users/lkhusid/gists{/gist_id}","starred_url":"https://api.github.com/users/lkhusid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lkhusid/subscriptions","organizations_url":"https://api.github.com/users/lkhusid/orgs","repos_url":"https://api.github.com/users/lkhusid/repos","events_url":"https://api.github.com/users/lkhusid/events{/privacy}","received_events_url":"https://api.github.com/users/lkhusid/received_events","type":"User","site_admin":false},"repo":{"id":67230266,"name":"antenna","full_name":"lkhusid/antenna","owner":{"login":"lkhusid","id":716542,"avatar_url":"https://avatars.githubusercontent.com/u/716542?v=3","gravatar_id":"","url":"https://api.github.com/users/lkhusid","html_url":"https://github.com/lkhusid","followers_url":"https://api.github.com/users/lkhusid/followers","following_url":"https://api.github.com/users/lkhusid/following{/other_user}","gists_url":"https://api.github.com/users/lkhusid/gists{/gist_id}","starred_url":"https://api.github.com/users/lkhusid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lkhusid/subscriptions","organizations_url":"https://api.github.com/users/lkhusid/orgs","repos_url":"https://api.github.com/users/lkhusid/repos","events_url":"https://api.github.com/users/lkhusid/events{/privacy}","received_events_url":"https://api.github.com/users/lkhusid/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lkhusid/antenna","description":"Notification system","fork":true,"url":"https://api.github.com/repos/lkhusid/antenna","forks_url":"https://api.github.com/repos/lkhusid/antenna/forks","keys_url":"https://api.github.com/repos/lkhusid/antenna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lkhusid/antenna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lkhusid/antenna/teams","hooks_url":"https://api.github.com/repos/lkhusid/antenna/hooks","issue_events_url":"https://api.github.com/repos/lkhusid/antenna/issues/events{/number}","events_url":"https://api.github.com/repos/lkhusid/antenna/events","assignees_url":"https://api.github.com/repos/lkhusid/antenna/assignees{/user}","branches_url":"https://api.github.com/repos/lkhusid/antenna/branches{/branch}","tags_url":"https://api.github.com/repos/lkhusid/antenna/tags","blobs_url":"https://api.github.com/repos/lkhusid/antenna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lkhusid/antenna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lkhusid/antenna/git/refs{/sha}","trees_url":"https://api.github.com/repos/lkhusid/antenna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lkhusid/antenna/statuses/{sha}","languages_url":"https://api.github.com/repos/lkhusid/antenna/languages","stargazers_url":"https://api.github.com/repos/lkhusid/antenna/stargazers","contributors_url":"https://api.github.com/repos/lkhusid/antenna/contributors","subscribers_url":"https://api.github.com/repos/lkhusid/antenna/subscribers","subscription_url":"https://api.github.com/repos/lkhusid/antenna/subscription","commits_url":"https://api.github.com/repos/lkhusid/antenna/commits{/sha}","git_commits_url":"https://api.github.com/repos/lkhusid/antenna/git/commits{/sha}","comments_url":"https://api.github.com/repos/lkhusid/antenna/comments{/number}","issue_comment_url":"https://api.github.com/repos/lkhusid/antenna/issues/comments{/number}","contents_url":"https://api.github.com/repos/lkhusid/antenna/contents/{+path}","compare_url":"https://api.github.com/repos/lkhusid/antenna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lkhusid/antenna/merges","archive_url":"https://api.github.com/repos/lkhusid/antenna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lkhusid/antenna/downloads","issues_url":"https://api.github.com/repos/lkhusid/antenna/issues{/number}","pulls_url":"https://api.github.com/repos/lkhusid/antenna/pulls{/number}","milestones_url":"https://api.github.com/repos/lkhusid/antenna/milestones{/number}","notifications_url":"https://api.github.com/repos/lkhusid/antenna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lkhusid/antenna/labels{/name}","releases_url":"https://api.github.com/repos/lkhusid/antenna/releases{/id}","deployments_url":"https://api.github.com/repos/lkhusid/antenna/deployments","created_at":"2016-09-02T14:40:07Z","updated_at":"2016-09-02T14:40:08Z","pushed_at":"2016-10-27T02:43:03Z","git_url":"git://github.com/lkhusid/antenna.git","ssh_url":"git@github.com:lkhusid/antenna.git","clone_url":"https://github.com/lkhusid/antenna.git","svn_url":"https://github.com/lkhusid/antenna","homepage":null,"size":90,"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":"oneops:master","ref":"master","sha":"f2200fb32ed52e1b93d76fd457cddad08ada3433","user":{"login":"oneops","id":1897270,"avatar_url":"https://avatars.githubusercontent.com/u/1897270?v=3","gravatar_id":"","url":"https://api.github.com/users/oneops","html_url":"https://github.com/oneops","followers_url":"https://api.github.com/users/oneops/followers","following_url":"https://api.github.com/users/oneops/following{/other_user}","gists_url":"https://api.github.com/users/oneops/gists{/gist_id}","starred_url":"https://api.github.com/users/oneops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oneops/subscriptions","organizations_url":"https://api.github.com/users/oneops/orgs","repos_url":"https://api.github.com/users/oneops/repos","events_url":"https://api.github.com/users/oneops/events{/privacy}","received_events_url":"https://api.github.com/users/oneops/received_events","type":"Organization","site_admin":false},"repo":{"id":46299085,"name":"antenna","full_name":"oneops/antenna","owner":{"login":"oneops","id":1897270,"avatar_url":"https://avatars.githubusercontent.com/u/1897270?v=3","gravatar_id":"","url":"https://api.github.com/users/oneops","html_url":"https://github.com/oneops","followers_url":"https://api.github.com/users/oneops/followers","following_url":"https://api.github.com/users/oneops/following{/other_user}","gists_url":"https://api.github.com/users/oneops/gists{/gist_id}","starred_url":"https://api.github.com/users/oneops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oneops/subscriptions","organizations_url":"https://api.github.com/users/oneops/orgs","repos_url":"https://api.github.com/users/oneops/repos","events_url":"https://api.github.com/users/oneops/events{/privacy}","received_events_url":"https://api.github.com/users/oneops/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oneops/antenna","description":"Notification system","fork":false,"url":"https://api.github.com/repos/oneops/antenna","forks_url":"https://api.github.com/repos/oneops/antenna/forks","keys_url":"https://api.github.com/repos/oneops/antenna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oneops/antenna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oneops/antenna/teams","hooks_url":"https://api.github.com/repos/oneops/antenna/hooks","issue_events_url":"https://api.github.com/repos/oneops/antenna/issues/events{/number}","events_url":"https://api.github.com/repos/oneops/antenna/events","assignees_url":"https://api.github.com/repos/oneops/antenna/assignees{/user}","branches_url":"https://api.github.com/repos/oneops/antenna/branches{/branch}","tags_url":"https://api.github.com/repos/oneops/antenna/tags","blobs_url":"https://api.github.com/repos/oneops/antenna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oneops/antenna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oneops/antenna/git/refs{/sha}","trees_url":"https://api.github.com/repos/oneops/antenna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oneops/antenna/statuses/{sha}","languages_url":"https://api.github.com/repos/oneops/antenna/languages","stargazers_url":"https://api.github.com/repos/oneops/antenna/stargazers","contributors_url":"https://api.github.com/repos/oneops/antenna/contributors","subscribers_url":"https://api.github.com/repos/oneops/antenna/subscribers","subscription_url":"https://api.github.com/repos/oneops/antenna/subscription","commits_url":"https://api.github.com/repos/oneops/antenna/commits{/sha}","git_commits_url":"https://api.github.com/repos/oneops/antenna/git/commits{/sha}","comments_url":"https://api.github.com/repos/oneops/antenna/comments{/number}","issue_comment_url":"https://api.github.com/repos/oneops/antenna/issues/comments{/number}","contents_url":"https://api.github.com/repos/oneops/antenna/contents/{+path}","compare_url":"https://api.github.com/repos/oneops/antenna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oneops/antenna/merges","archive_url":"https://api.github.com/repos/oneops/antenna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oneops/antenna/downloads","issues_url":"https://api.github.com/repos/oneops/antenna/issues{/number}","pulls_url":"https://api.github.com/repos/oneops/antenna/pulls{/number}","milestones_url":"https://api.github.com/repos/oneops/antenna/milestones{/number}","notifications_url":"https://api.github.com/repos/oneops/antenna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oneops/antenna/labels{/name}","releases_url":"https://api.github.com/repos/oneops/antenna/releases{/id}","deployments_url":"https://api.github.com/repos/oneops/antenna/deployments","created_at":"2015-11-16T20:04:01Z","updated_at":"2016-07-28T17:38:42Z","pushed_at":"2016-10-27T02:44:12Z","git_url":"git://github.com/oneops/antenna.git","ssh_url":"git@github.com:oneops/antenna.git","clone_url":"https://github.com/oneops/antenna.git","svn_url":"https://github.com/oneops/antenna","homepage":null,"size":125,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":1,"forks":13,"open_issues":1,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/oneops/antenna/pulls/19"},"html":{"href":"https://github.com/oneops/antenna/pull/19"},"issue":{"href":"https://api.github.com/repos/oneops/antenna/issues/19"},"comments":{"href":"https://api.github.com/repos/oneops/antenna/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/oneops/antenna/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/oneops/antenna/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oneops/antenna/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/oneops/antenna/statuses/6ea18987f1c158c64f895ec04d344757a4ca9c94"}}}}
{"actor":{"display_login":"sureshg"}}