{"action":"created","comment":{"url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/pulls/comments/243679677","pull_request_review_id":187522407,"id":243679677,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MzY3OTY3Nw==","diff_hunk":"@@ -76,6 +76,39 @@ public void testInsertion() {\n \t\t}\n \n \t}\n+\t\n+  @TestPropertySource(properties = \"jdbc.batchSize=1000\")\n+\tpublic static class SimpleBatchInsertTests extends JdbcSinkIntegrationTests {\n+\n+\t\t@Test\n+\t\tpublic void testBatchInsertion() {\n+      final int numberOfInserts = 5000;\n+\t\t\tPayload sent = new Payload(\"hello\", 42);\n+      for (int i = 0; i < numberOfInserts; i++) {\n+  \t\t\tchannels.input().send(MessageBuilder.withPayload(sent).build());\n+      }\n+      int result = jdbcOperations.queryForObject(\"select count(*) from messages\", Integer.class);\n+\t\t\tAssert.assertThat(result, is(numberOfInserts));\n+\t\t}\n+\n+\t}\n+\n+  @TestPropertySource(properties = { \"jdbc.batchSize=1000\", \"jdbc.idleTimeout=1000\" })\n+\tpublic static class BatchInsertTimeoutTests extends JdbcSinkIntegrationTests {\n+\n+\t\t@Test\n+\t\tpublic void testBatchInsertionTimeout() throws InterruptedException {\n+      final int numberOfInserts = 10;\n+\t\t\tPayload sent = new Payload(\"hello\", 42);\n+      for (int i = 0; i < numberOfInserts; i++) {\n+  \t\t\tchannels.input().send(MessageBuilder.withPayload(sent).build());\n+      }\n+      Assert.assertThat(jdbcOperations.queryForObject(\"select count(*) from messages\", Integer.class), is(0));\n+      Thread.sleep(2000); // wait 2s","path":"spring-cloud-starter-stream-sink-jdbc/src/test/java/org/springframework/cloud/stream/app/jdbc/sink/JdbcSinkIntegrationTests.java","position":null,"original_position":32,"commit_id":"2414ba2a1ccca536686c1892ef2a88a4de53120c","original_commit_id":"abb97a0ad482275125325d89fd0696b6b9d64525","user":{"login":"oflasch","id":172035,"node_id":"MDQ6VXNlcjE3MjAzNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/172035?v=4","gravatar_id":"","url":"https://api.github.com/users/oflasch","html_url":"https://github.com/oflasch","followers_url":"https://api.github.com/users/oflasch/followers","following_url":"https://api.github.com/users/oflasch/following{/other_user}","gists_url":"https://api.github.com/users/oflasch/gists{/gist_id}","starred_url":"https://api.github.com/users/oflasch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oflasch/subscriptions","organizations_url":"https://api.github.com/users/oflasch/orgs","repos_url":"https://api.github.com/users/oflasch/repos","events_url":"https://api.github.com/users/oflasch/events{/privacy}","received_events_url":"https://api.github.com/users/oflasch/received_events","type":"User","site_admin":false},"body":"Sure, that makes sense. I reduced `jdbc.idleTimeout` to 100 ms and the test wait time to 200 ms. Much shorter times seem to cause the test to fail occasionally, as the embedded database used for testing runs asynchronously. See commit 2414ba2a1ccca536686c1892ef2a88a4de53120c .","created_at":"2018-12-21T20:02:18Z","updated_at":"2018-12-21T20:02:18Z","html_url":"https://github.com/spring-cloud-stream-app-starters/jdbc/pull/30#discussion_r243679677","pull_request_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/pulls/30","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/pulls/comments/243679677"},"html":{"href":"https://github.com/spring-cloud-stream-app-starters/jdbc/pull/30#discussion_r243679677"},"pull_request":{"href":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/pulls/30"}},"in_reply_to_id":243620364},"pull_request":{"url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/pulls/30","id":240227516,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQwMjI3NTE2","html_url":"https://github.com/spring-cloud-stream-app-starters/jdbc/pull/30","diff_url":"https://github.com/spring-cloud-stream-app-starters/jdbc/pull/30.diff","patch_url":"https://github.com/spring-cloud-stream-app-starters/jdbc/pull/30.patch","issue_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/issues/30","number":30,"state":"open","locked":false,"title":"Support for JDBC batch inserts","user":{"login":"oflasch","id":172035,"node_id":"MDQ6VXNlcjE3MjAzNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/172035?v=4","gravatar_id":"","url":"https://api.github.com/users/oflasch","html_url":"https://github.com/oflasch","followers_url":"https://api.github.com/users/oflasch/followers","following_url":"https://api.github.com/users/oflasch/following{/other_user}","gists_url":"https://api.github.com/users/oflasch/gists{/gist_id}","starred_url":"https://api.github.com/users/oflasch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oflasch/subscriptions","organizations_url":"https://api.github.com/users/oflasch/orgs","repos_url":"https://api.github.com/users/oflasch/repos","events_url":"https://api.github.com/users/oflasch/events{/privacy}","received_events_url":"https://api.github.com/users/oflasch/received_events","type":"User","site_admin":false},"body":"We needed support for JDBC batch inserts to enable efficient data ingestion from fast Kafka topics. \r\n\r\nThis pull request uses Spring Integration aggregators to collect up to jdbc.batch-size messages before inserting them into the database. The configuration option jdbc.idle-timeout can be used to define a timeout in milliseconds after which the collected messages are flushed to the database, limiting the maximum latency.","created_at":"2018-12-20T16:23:45Z","updated_at":"2018-12-21T20:02:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"305fa4a982d18aefe5d84e4efcae61bb00260a03","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":506215043,"node_id":"MDU6TGFiZWw1MDYyMTUwNDM=","url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/labels/in%20pr","name":"in pr","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/pulls/30/commits","review_comments_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/pulls/30/comments","review_comment_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/issues/30/comments","statuses_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/statuses/2414ba2a1ccca536686c1892ef2a88a4de53120c","head":{"label":"sourcewerk:master","ref":"master","sha":"2414ba2a1ccca536686c1892ef2a88a4de53120c","user":{"login":"sourcewerk","id":11724084,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNzI0MDg0","avatar_url":"https://avatars3.githubusercontent.com/u/11724084?v=4","gravatar_id":"","url":"https://api.github.com/users/sourcewerk","html_url":"https://github.com/sourcewerk","followers_url":"https://api.github.com/users/sourcewerk/followers","following_url":"https://api.github.com/users/sourcewerk/following{/other_user}","gists_url":"https://api.github.com/users/sourcewerk/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcewerk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcewerk/subscriptions","organizations_url":"https://api.github.com/users/sourcewerk/orgs","repos_url":"https://api.github.com/users/sourcewerk/repos","events_url":"https://api.github.com/users/sourcewerk/events{/privacy}","received_events_url":"https://api.github.com/users/sourcewerk/received_events","type":"Organization","site_admin":false},"repo":{"id":162601578,"node_id":"MDEwOlJlcG9zaXRvcnkxNjI2MDE1Nzg=","name":"jdbc","full_name":"sourcewerk/jdbc","private":false,"owner":{"login":"sourcewerk","id":11724084,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNzI0MDg0","avatar_url":"https://avatars3.githubusercontent.com/u/11724084?v=4","gravatar_id":"","url":"https://api.github.com/users/sourcewerk","html_url":"https://github.com/sourcewerk","followers_url":"https://api.github.com/users/sourcewerk/followers","following_url":"https://api.github.com/users/sourcewerk/following{/other_user}","gists_url":"https://api.github.com/users/sourcewerk/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcewerk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcewerk/subscriptions","organizations_url":"https://api.github.com/users/sourcewerk/orgs","repos_url":"https://api.github.com/users/sourcewerk/repos","events_url":"https://api.github.com/users/sourcewerk/events{/privacy}","received_events_url":"https://api.github.com/users/sourcewerk/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/sourcewerk/jdbc","description":null,"fork":true,"url":"https://api.github.com/repos/sourcewerk/jdbc","forks_url":"https://api.github.com/repos/sourcewerk/jdbc/forks","keys_url":"https://api.github.com/repos/sourcewerk/jdbc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sourcewerk/jdbc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sourcewerk/jdbc/teams","hooks_url":"https://api.github.com/repos/sourcewerk/jdbc/hooks","issue_events_url":"https://api.github.com/repos/sourcewerk/jdbc/issues/events{/number}","events_url":"https://api.github.com/repos/sourcewerk/jdbc/events","assignees_url":"https://api.github.com/repos/sourcewerk/jdbc/assignees{/user}","branches_url":"https://api.github.com/repos/sourcewerk/jdbc/branches{/branch}","tags_url":"https://api.github.com/repos/sourcewerk/jdbc/tags","blobs_url":"https://api.github.com/repos/sourcewerk/jdbc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sourcewerk/jdbc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sourcewerk/jdbc/git/refs{/sha}","trees_url":"https://api.github.com/repos/sourcewerk/jdbc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sourcewerk/jdbc/statuses/{sha}","languages_url":"https://api.github.com/repos/sourcewerk/jdbc/languages","stargazers_url":"https://api.github.com/repos/sourcewerk/jdbc/stargazers","contributors_url":"https://api.github.com/repos/sourcewerk/jdbc/contributors","subscribers_url":"https://api.github.com/repos/sourcewerk/jdbc/subscribers","subscription_url":"https://api.github.com/repos/sourcewerk/jdbc/subscription","commits_url":"https://api.github.com/repos/sourcewerk/jdbc/commits{/sha}","git_commits_url":"https://api.github.com/repos/sourcewerk/jdbc/git/commits{/sha}","comments_url":"https://api.github.com/repos/sourcewerk/jdbc/comments{/number}","issue_comment_url":"https://api.github.com/repos/sourcewerk/jdbc/issues/comments{/number}","contents_url":"https://api.github.com/repos/sourcewerk/jdbc/contents/{+path}","compare_url":"https://api.github.com/repos/sourcewerk/jdbc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sourcewerk/jdbc/merges","archive_url":"https://api.github.com/repos/sourcewerk/jdbc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sourcewerk/jdbc/downloads","issues_url":"https://api.github.com/repos/sourcewerk/jdbc/issues{/number}","pulls_url":"https://api.github.com/repos/sourcewerk/jdbc/pulls{/number}","milestones_url":"https://api.github.com/repos/sourcewerk/jdbc/milestones{/number}","notifications_url":"https://api.github.com/repos/sourcewerk/jdbc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sourcewerk/jdbc/labels{/name}","releases_url":"https://api.github.com/repos/sourcewerk/jdbc/releases{/id}","deployments_url":"https://api.github.com/repos/sourcewerk/jdbc/deployments","created_at":"2018-12-20T16:01:54Z","updated_at":"2018-12-21T19:54:56Z","pushed_at":"2018-12-21T19:54:55Z","git_url":"git://github.com/sourcewerk/jdbc.git","ssh_url":"git@github.com:sourcewerk/jdbc.git","clone_url":"https://github.com/sourcewerk/jdbc.git","svn_url":"https://github.com/sourcewerk/jdbc","homepage":null,"size":172,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spring-cloud-stream-app-starters:master","ref":"master","sha":"d4d228d078cf418b1773eef0686317d510e78d6a","user":{"login":"spring-cloud-stream-app-starters","id":22753134,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyNzUzMTM0","avatar_url":"https://avatars1.githubusercontent.com/u/22753134?v=4","gravatar_id":"","url":"https://api.github.com/users/spring-cloud-stream-app-starters","html_url":"https://github.com/spring-cloud-stream-app-starters","followers_url":"https://api.github.com/users/spring-cloud-stream-app-starters/followers","following_url":"https://api.github.com/users/spring-cloud-stream-app-starters/following{/other_user}","gists_url":"https://api.github.com/users/spring-cloud-stream-app-starters/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-cloud-stream-app-starters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-cloud-stream-app-starters/subscriptions","organizations_url":"https://api.github.com/users/spring-cloud-stream-app-starters/orgs","repos_url":"https://api.github.com/users/spring-cloud-stream-app-starters/repos","events_url":"https://api.github.com/users/spring-cloud-stream-app-starters/events{/privacy}","received_events_url":"https://api.github.com/users/spring-cloud-stream-app-starters/received_events","type":"Organization","site_admin":false},"repo":{"id":72219864,"node_id":"MDEwOlJlcG9zaXRvcnk3MjIxOTg2NA==","name":"jdbc","full_name":"spring-cloud-stream-app-starters/jdbc","private":false,"owner":{"login":"spring-cloud-stream-app-starters","id":22753134,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyNzUzMTM0","avatar_url":"https://avatars1.githubusercontent.com/u/22753134?v=4","gravatar_id":"","url":"https://api.github.com/users/spring-cloud-stream-app-starters","html_url":"https://github.com/spring-cloud-stream-app-starters","followers_url":"https://api.github.com/users/spring-cloud-stream-app-starters/followers","following_url":"https://api.github.com/users/spring-cloud-stream-app-starters/following{/other_user}","gists_url":"https://api.github.com/users/spring-cloud-stream-app-starters/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-cloud-stream-app-starters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-cloud-stream-app-starters/subscriptions","organizations_url":"https://api.github.com/users/spring-cloud-stream-app-starters/orgs","repos_url":"https://api.github.com/users/spring-cloud-stream-app-starters/repos","events_url":"https://api.github.com/users/spring-cloud-stream-app-starters/events{/privacy}","received_events_url":"https://api.github.com/users/spring-cloud-stream-app-starters/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/spring-cloud-stream-app-starters/jdbc","description":null,"fork":false,"url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc","forks_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/forks","keys_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/teams","hooks_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/hooks","issue_events_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/issues/events{/number}","events_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/events","assignees_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/assignees{/user}","branches_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/branches{/branch}","tags_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/tags","blobs_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/git/refs{/sha}","trees_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/statuses/{sha}","languages_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/languages","stargazers_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/stargazers","contributors_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/contributors","subscribers_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/subscribers","subscription_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/subscription","commits_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/commits{/sha}","git_commits_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/git/commits{/sha}","comments_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/comments{/number}","issue_comment_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/issues/comments{/number}","contents_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/contents/{+path}","compare_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/merges","archive_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/downloads","issues_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/issues{/number}","pulls_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/pulls{/number}","milestones_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/milestones{/number}","notifications_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/labels{/name}","releases_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/releases{/id}","deployments_url":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/deployments","created_at":"2016-10-28T15:34:53Z","updated_at":"2018-12-14T00:49:57Z","pushed_at":"2018-12-21T19:54:56Z","git_url":"git://github.com/spring-cloud-stream-app-starters/jdbc.git","ssh_url":"git@github.com:spring-cloud-stream-app-starters/jdbc.git","clone_url":"https://github.com/spring-cloud-stream-app-starters/jdbc.git","svn_url":"https://github.com/spring-cloud-stream-app-starters/jdbc","homepage":null,"size":168,"stargazers_count":7,"watchers_count":7,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":10,"open_issues":7,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/pulls/30"},"html":{"href":"https://github.com/spring-cloud-stream-app-starters/jdbc/pull/30"},"issue":{"href":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/issues/30"},"comments":{"href":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/spring-cloud-stream-app-starters/jdbc/statuses/2414ba2a1ccca536686c1892ef2a88a4de53120c"}},"author_association":"NONE"}}
{"actor":{"display_login":"oflasch"}}