{"action":"created","comment":{"url":"https://api.github.com/repos/spring-projects/spring-amqp/pulls/comments/88354179","pull_request_review_id":8931043,"id":88354179,"diff_hunk":"@@ -349,6 +356,71 @@ public void testHardErrorAndReconnect() throws Exception {\n \t}\n \n \t@Test\n+\tpublic void testHardErrorAndReconnectAuto() throws Exception {\n+\n+\t\tRabbitTemplate template = new RabbitTemplate(connectionFactory);\n+\t\tRabbitAdmin admin = new RabbitAdmin(connectionFactory);\n+\t\tQueue queue = new Queue(CF_INTEGRATION_TEST_QUEUE);\n+\t\tadmin.declareQueue(queue);\n+\t\tfinal String route = queue.getName();\n+\n+\t\tfinal CountDownLatch latch = new CountDownLatch(1);\n+\t\tfinal CountDownLatch recoveryLatch = new CountDownLatch(1);\n+\t\tfinal RecoveryListener listener = new RecoveryListener() {\n+\n+\t\t\t@Override\n+\t\t\tpublic void handleRecoveryStarted(Recoverable recoverable) {\n+\t\t\t\t//NOSONAR\n+\t\t\t}\n+\n+\t\t\t@Override\n+\t\t\tpublic void handleRecovery(Recoverable recoverable) {\n+\t\t\t\ttry {\n+\t\t\t\t\t((Channel) recoverable).basicCancel(\"testHardErrorAndReconnect\");\n+\t\t\t\t}\n+\t\t\t\tcatch (IOException e) {\n+\t\t\t\t}\n+\t\t\t\trecoveryLatch.countDown();\n+\t\t\t}\n+\n+\t\t};\n+\t\ttry {\n+\t\t\ttemplate.execute(channel -> {\n+\t\t\t\tchannel.getConnection().addShutdownListener(cause -> {\n+\t\t\t\t\tlogger.info(\"Error\", cause);\n+\t\t\t\t\tlatch.countDown();\n+\t\t\t\t\t// This will be thrown on the Connection thread just before it dies, so basically ignored\n+\t\t\t\t\tthrow new RuntimeException(cause);\n+\t\t\t\t});\n+\t\t\t\tChannel targetChannel = ((ChannelProxy) channel).getTargetChannel();\n+\t\t\t\tif (targetChannel instanceof AutorecoveringChannel) {\n+\t\t\t\t\t((AutorecoveringChannel) targetChannel).addRecoveryListener(listener);\n+\t\t\t\t}\n+\t\t\t\telse {\n+\t\t\t\t\trecoveryLatch.countDown();","path":"spring-rabbit/src/test/java/org/springframework/amqp/rabbit/connection/CachingConnectionFactoryIntegrationTests.java","position":100,"original_position":100,"commit_id":"c5ac55039ca10ea543f563f8cd448812e2cbd57d","original_commit_id":"c5ac55039ca10ea543f563f8cd448812e2cbd57d","user":{"login":"artembilan","id":1071590,"avatar_url":"https://avatars.githubusercontent.com/u/1071590?v=3","gravatar_id":"","url":"https://api.github.com/users/artembilan","html_url":"https://github.com/artembilan","followers_url":"https://api.github.com/users/artembilan/followers","following_url":"https://api.github.com/users/artembilan/following{/other_user}","gists_url":"https://api.github.com/users/artembilan/gists{/gist_id}","starred_url":"https://api.github.com/users/artembilan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artembilan/subscriptions","organizations_url":"https://api.github.com/users/artembilan/orgs","repos_url":"https://api.github.com/users/artembilan/repos","events_url":"https://api.github.com/users/artembilan/events{/privacy}","received_events_url":"https://api.github.com/users/artembilan/received_events","type":"User","site_admin":false},"body":"And do we run such one?\r\nI just want to be sure that all the code in test-case makes sense.","created_at":"2016-11-16T23:18:59Z","updated_at":"2016-11-16T23:18:59Z","html_url":"https://github.com/spring-projects/spring-amqp/pull/501#discussion_r88354179","pull_request_url":"https://api.github.com/repos/spring-projects/spring-amqp/pulls/501","_links":{"self":{"href":"https://api.github.com/repos/spring-projects/spring-amqp/pulls/comments/88354179"},"html":{"href":"https://github.com/spring-projects/spring-amqp/pull/501#discussion_r88354179"},"pull_request":{"href":"https://api.github.com/repos/spring-projects/spring-amqp/pulls/501"}}},"pull_request":{"url":"https://api.github.com/repos/spring-projects/spring-amqp/pulls/501","id":94008897,"html_url":"https://github.com/spring-projects/spring-amqp/pull/501","diff_url":"https://github.com/spring-projects/spring-amqp/pull/501.diff","patch_url":"https://github.com/spring-projects/spring-amqp/pull/501.patch","issue_url":"https://api.github.com/repos/spring-projects/spring-amqp/issues/501","number":501,"state":"open","locked":false,"title":"AMQP-673: 4.0.0.RC2 Client Phase 1, 2 (of 2)","user":{"login":"garyrussell","id":483832,"avatar_url":"https://avatars.githubusercontent.com/u/483832?v=3","gravatar_id":"","url":"https://api.github.com/users/garyrussell","html_url":"https://github.com/garyrussell","followers_url":"https://api.github.com/users/garyrussell/followers","following_url":"https://api.github.com/users/garyrussell/following{/other_user}","gists_url":"https://api.github.com/users/garyrussell/gists{/gist_id}","starred_url":"https://api.github.com/users/garyrussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garyrussell/subscriptions","organizations_url":"https://api.github.com/users/garyrussell/orgs","repos_url":"https://api.github.com/users/garyrussell/repos","events_url":"https://api.github.com/users/garyrussell/events{/privacy}","received_events_url":"https://api.github.com/users/garyrussell/received_events","type":"User","site_admin":false},"body":"JIRA: https://jira.spring.io/browse/AMQP-673\r\n\r\nRemove Use of Deprecated QueueingConsumer","created_at":"2016-11-16T17:10:07Z","updated_at":"2016-11-16T23:18:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f92ac664b69ad6030404504fa46f4a2cb9b2e591","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/spring-projects/spring-amqp/pulls/501/commits","review_comments_url":"https://api.github.com/repos/spring-projects/spring-amqp/pulls/501/comments","review_comment_url":"https://api.github.com/repos/spring-projects/spring-amqp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spring-projects/spring-amqp/issues/501/comments","statuses_url":"https://api.github.com/repos/spring-projects/spring-amqp/statuses/c5ac55039ca10ea543f563f8cd448812e2cbd57d","head":{"label":"garyrussell:AMQP-673","ref":"AMQP-673","sha":"c5ac55039ca10ea543f563f8cd448812e2cbd57d","user":{"login":"garyrussell","id":483832,"avatar_url":"https://avatars.githubusercontent.com/u/483832?v=3","gravatar_id":"","url":"https://api.github.com/users/garyrussell","html_url":"https://github.com/garyrussell","followers_url":"https://api.github.com/users/garyrussell/followers","following_url":"https://api.github.com/users/garyrussell/following{/other_user}","gists_url":"https://api.github.com/users/garyrussell/gists{/gist_id}","starred_url":"https://api.github.com/users/garyrussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garyrussell/subscriptions","organizations_url":"https://api.github.com/users/garyrussell/orgs","repos_url":"https://api.github.com/users/garyrussell/repos","events_url":"https://api.github.com/users/garyrussell/events{/privacy}","received_events_url":"https://api.github.com/users/garyrussell/received_events","type":"User","site_admin":false},"repo":{"id":3138424,"name":"spring-amqp","full_name":"garyrussell/spring-amqp","owner":{"login":"garyrussell","id":483832,"avatar_url":"https://avatars.githubusercontent.com/u/483832?v=3","gravatar_id":"","url":"https://api.github.com/users/garyrussell","html_url":"https://github.com/garyrussell","followers_url":"https://api.github.com/users/garyrussell/followers","following_url":"https://api.github.com/users/garyrussell/following{/other_user}","gists_url":"https://api.github.com/users/garyrussell/gists{/gist_id}","starred_url":"https://api.github.com/users/garyrussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garyrussell/subscriptions","organizations_url":"https://api.github.com/users/garyrussell/orgs","repos_url":"https://api.github.com/users/garyrussell/repos","events_url":"https://api.github.com/users/garyrussell/events{/privacy}","received_events_url":"https://api.github.com/users/garyrussell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/garyrussell/spring-amqp","description":"Spring AMQP - support for Spring programming model with AMQP, especially but not limited to RabbitMQ","fork":true,"url":"https://api.github.com/repos/garyrussell/spring-amqp","forks_url":"https://api.github.com/repos/garyrussell/spring-amqp/forks","keys_url":"https://api.github.com/repos/garyrussell/spring-amqp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/garyrussell/spring-amqp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/garyrussell/spring-amqp/teams","hooks_url":"https://api.github.com/repos/garyrussell/spring-amqp/hooks","issue_events_url":"https://api.github.com/repos/garyrussell/spring-amqp/issues/events{/number}","events_url":"https://api.github.com/repos/garyrussell/spring-amqp/events","assignees_url":"https://api.github.com/repos/garyrussell/spring-amqp/assignees{/user}","branches_url":"https://api.github.com/repos/garyrussell/spring-amqp/branches{/branch}","tags_url":"https://api.github.com/repos/garyrussell/spring-amqp/tags","blobs_url":"https://api.github.com/repos/garyrussell/spring-amqp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/garyrussell/spring-amqp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/garyrussell/spring-amqp/git/refs{/sha}","trees_url":"https://api.github.com/repos/garyrussell/spring-amqp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/garyrussell/spring-amqp/statuses/{sha}","languages_url":"https://api.github.com/repos/garyrussell/spring-amqp/languages","stargazers_url":"https://api.github.com/repos/garyrussell/spring-amqp/stargazers","contributors_url":"https://api.github.com/repos/garyrussell/spring-amqp/contributors","subscribers_url":"https://api.github.com/repos/garyrussell/spring-amqp/subscribers","subscription_url":"https://api.github.com/repos/garyrussell/spring-amqp/subscription","commits_url":"https://api.github.com/repos/garyrussell/spring-amqp/commits{/sha}","git_commits_url":"https://api.github.com/repos/garyrussell/spring-amqp/git/commits{/sha}","comments_url":"https://api.github.com/repos/garyrussell/spring-amqp/comments{/number}","issue_comment_url":"https://api.github.com/repos/garyrussell/spring-amqp/issues/comments{/number}","contents_url":"https://api.github.com/repos/garyrussell/spring-amqp/contents/{+path}","compare_url":"https://api.github.com/repos/garyrussell/spring-amqp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/garyrussell/spring-amqp/merges","archive_url":"https://api.github.com/repos/garyrussell/spring-amqp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/garyrussell/spring-amqp/downloads","issues_url":"https://api.github.com/repos/garyrussell/spring-amqp/issues{/number}","pulls_url":"https://api.github.com/repos/garyrussell/spring-amqp/pulls{/number}","milestones_url":"https://api.github.com/repos/garyrussell/spring-amqp/milestones{/number}","notifications_url":"https://api.github.com/repos/garyrussell/spring-amqp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/garyrussell/spring-amqp/labels{/name}","releases_url":"https://api.github.com/repos/garyrussell/spring-amqp/releases{/id}","deployments_url":"https://api.github.com/repos/garyrussell/spring-amqp/deployments","created_at":"2012-01-09T17:21:18Z","updated_at":"2016-11-07T13:32:11Z","pushed_at":"2016-11-16T21:56:34Z","git_url":"git://github.com/garyrussell/spring-amqp.git","ssh_url":"git@github.com:garyrussell/spring-amqp.git","clone_url":"https://github.com/garyrussell/spring-amqp.git","svn_url":"https://github.com/garyrussell/spring-amqp","homepage":"http://www.springsource.org/spring-amqp","size":8496,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":4,"default_branch":"master"}},"base":{"label":"spring-projects:master","ref":"master","sha":"33ce19fb8012db4c6a7e37fc0b11b74eeda82994","user":{"login":"spring-projects","id":317776,"avatar_url":"https://avatars.githubusercontent.com/u/317776?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-projects","html_url":"https://github.com/spring-projects","followers_url":"https://api.github.com/users/spring-projects/followers","following_url":"https://api.github.com/users/spring-projects/following{/other_user}","gists_url":"https://api.github.com/users/spring-projects/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-projects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-projects/subscriptions","organizations_url":"https://api.github.com/users/spring-projects/orgs","repos_url":"https://api.github.com/users/spring-projects/repos","events_url":"https://api.github.com/users/spring-projects/events{/privacy}","received_events_url":"https://api.github.com/users/spring-projects/received_events","type":"Organization","site_admin":false},"repo":{"id":1088796,"name":"spring-amqp","full_name":"spring-projects/spring-amqp","owner":{"login":"spring-projects","id":317776,"avatar_url":"https://avatars.githubusercontent.com/u/317776?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-projects","html_url":"https://github.com/spring-projects","followers_url":"https://api.github.com/users/spring-projects/followers","following_url":"https://api.github.com/users/spring-projects/following{/other_user}","gists_url":"https://api.github.com/users/spring-projects/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-projects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-projects/subscriptions","organizations_url":"https://api.github.com/users/spring-projects/orgs","repos_url":"https://api.github.com/users/spring-projects/repos","events_url":"https://api.github.com/users/spring-projects/events{/privacy}","received_events_url":"https://api.github.com/users/spring-projects/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spring-projects/spring-amqp","description":"Spring AMQP - support for Spring programming model with AMQP, especially but not limited to RabbitMQ","fork":false,"url":"https://api.github.com/repos/spring-projects/spring-amqp","forks_url":"https://api.github.com/repos/spring-projects/spring-amqp/forks","keys_url":"https://api.github.com/repos/spring-projects/spring-amqp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spring-projects/spring-amqp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spring-projects/spring-amqp/teams","hooks_url":"https://api.github.com/repos/spring-projects/spring-amqp/hooks","issue_events_url":"https://api.github.com/repos/spring-projects/spring-amqp/issues/events{/number}","events_url":"https://api.github.com/repos/spring-projects/spring-amqp/events","assignees_url":"https://api.github.com/repos/spring-projects/spring-amqp/assignees{/user}","branches_url":"https://api.github.com/repos/spring-projects/spring-amqp/branches{/branch}","tags_url":"https://api.github.com/repos/spring-projects/spring-amqp/tags","blobs_url":"https://api.github.com/repos/spring-projects/spring-amqp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spring-projects/spring-amqp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spring-projects/spring-amqp/git/refs{/sha}","trees_url":"https://api.github.com/repos/spring-projects/spring-amqp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spring-projects/spring-amqp/statuses/{sha}","languages_url":"https://api.github.com/repos/spring-projects/spring-amqp/languages","stargazers_url":"https://api.github.com/repos/spring-projects/spring-amqp/stargazers","contributors_url":"https://api.github.com/repos/spring-projects/spring-amqp/contributors","subscribers_url":"https://api.github.com/repos/spring-projects/spring-amqp/subscribers","subscription_url":"https://api.github.com/repos/spring-projects/spring-amqp/subscription","commits_url":"https://api.github.com/repos/spring-projects/spring-amqp/commits{/sha}","git_commits_url":"https://api.github.com/repos/spring-projects/spring-amqp/git/commits{/sha}","comments_url":"https://api.github.com/repos/spring-projects/spring-amqp/comments{/number}","issue_comment_url":"https://api.github.com/repos/spring-projects/spring-amqp/issues/comments{/number}","contents_url":"https://api.github.com/repos/spring-projects/spring-amqp/contents/{+path}","compare_url":"https://api.github.com/repos/spring-projects/spring-amqp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spring-projects/spring-amqp/merges","archive_url":"https://api.github.com/repos/spring-projects/spring-amqp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spring-projects/spring-amqp/downloads","issues_url":"https://api.github.com/repos/spring-projects/spring-amqp/issues{/number}","pulls_url":"https://api.github.com/repos/spring-projects/spring-amqp/pulls{/number}","milestones_url":"https://api.github.com/repos/spring-projects/spring-amqp/milestones{/number}","notifications_url":"https://api.github.com/repos/spring-projects/spring-amqp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spring-projects/spring-amqp/labels{/name}","releases_url":"https://api.github.com/repos/spring-projects/spring-amqp/releases{/id}","deployments_url":"https://api.github.com/repos/spring-projects/spring-amqp/deployments","created_at":"2010-11-17T15:50:16Z","updated_at":"2016-11-16T05:41:41Z","pushed_at":"2016-11-16T22:54:30Z","git_url":"git://github.com/spring-projects/spring-amqp.git","ssh_url":"git@github.com:spring-projects/spring-amqp.git","clone_url":"https://github.com/spring-projects/spring-amqp.git","svn_url":"https://github.com/spring-projects/spring-amqp","homepage":"http://www.springsource.org/spring-amqp","size":9638,"stargazers_count":271,"watchers_count":271,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":239,"mirror_url":null,"open_issues_count":1,"forks":239,"open_issues":1,"watchers":271,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spring-projects/spring-amqp/pulls/501"},"html":{"href":"https://github.com/spring-projects/spring-amqp/pull/501"},"issue":{"href":"https://api.github.com/repos/spring-projects/spring-amqp/issues/501"},"comments":{"href":"https://api.github.com/repos/spring-projects/spring-amqp/issues/501/comments"},"review_comments":{"href":"https://api.github.com/repos/spring-projects/spring-amqp/pulls/501/comments"},"review_comment":{"href":"https://api.github.com/repos/spring-projects/spring-amqp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spring-projects/spring-amqp/pulls/501/commits"},"statuses":{"href":"https://api.github.com/repos/spring-projects/spring-amqp/statuses/c5ac55039ca10ea543f563f8cd448812e2cbd57d"}}}}
{"actor":{"display_login":"artembilan"}}