{"action":"created","comment":{"url":"https://api.github.com/repos/spring-projects/spring-integration/pulls/comments/83057758","pull_request_review_id":3923313,"id":83057758,"diff_hunk":"@@ -44,39 +41,61 @@\n \n \tprotected static final String MESSAGE_GROUP_KEY_PREFIX = \"MESSAGE_GROUP_\";\n \n+\t/**\n+\t * Represents the time when the message has been added to the store.\n+\t * @deprecated since 5.0. This constant isn't used any more.\n+\t */\n+\t@Deprecated\n \tprotected static final String CREATED_DATE = \"CREATED_DATE\";\n \n \t// MessageStore methods\n \n \t@Override\n-\tpublic Message<?> getMessage(UUID id) {\n-\t\tMessage<?> message = getRawMessage(id);\n-\t\tif (message != null) {\n-\t\t\treturn normalizeMessage(message);\n+\tpublic Message<?> getMessage(UUID messageId) {\n+\t\tAssert.notNull(messageId, \"'messageId' must not be null\");\n+\t\tMessageHolder messageHolder = (MessageHolder) doRetrieve(MESSAGE_KEY_PREFIX + messageId);\n+\t\tif (messageHolder != null) {\n+\t\t\tAssert.isInstanceOf(MessageHolder.class, messageHolder);","path":"spring-integration-core/src/main/java/org/springframework/integration/store/AbstractKeyValueMessageStore.java","position":37,"original_position":37,"commit_id":"b2a9ffae3b917de22f212f509d39fc0ae4c28916","original_commit_id":"b2a9ffae3b917de22f212f509d39fc0ae4c28916","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":"? We would have gotten a `ClassCastException` above.","created_at":"2016-10-12T17:34:45Z","updated_at":"2016-10-12T17:41:13Z","html_url":"https://github.com/spring-projects/spring-integration/pull/1916#discussion_r83057758","pull_request_url":"https://api.github.com/repos/spring-projects/spring-integration/pulls/1916","_links":{"self":{"href":"https://api.github.com/repos/spring-projects/spring-integration/pulls/comments/83057758"},"html":{"href":"https://github.com/spring-projects/spring-integration/pull/1916#discussion_r83057758"},"pull_request":{"href":"https://api.github.com/repos/spring-projects/spring-integration/pulls/1916"}}},"pull_request":{"url":"https://api.github.com/repos/spring-projects/spring-integration/pulls/1916","id":87409029,"html_url":"https://github.com/spring-projects/spring-integration/pull/1916","diff_url":"https://github.com/spring-projects/spring-integration/pull/1916.diff","patch_url":"https://github.com/spring-projects/spring-integration/pull/1916.patch","issue_url":"https://api.github.com/repos/spring-projects/spring-integration/issues/1916","number":1916,"state":"open","locked":false,"title":"INT-2460: Remove message modification logic in MS","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":"JIRA: https://jira.spring.io/browse/INT-2460,\r\nhttps://jira.spring.io/browse/INT-4122\r\n\r\nSince the main purpose of the `MessageStore` to persist message for durability and only,\r\nit doesn't make sense to modify `Message` for additional headers like `SAVED` and `CREATED_DATE`.\r\nSuch a logic should be a part of metadata stored together with the message.\r\nAnd it is provided by the out-of-the-box `MessageStore` implementation.\r\nIn addition we free ourselves from the reflection operations to retain `ID` and `TIMESTAMP` headers when we add `SAVED` and `CREATED_DATE`\r\n\r\n* Control \"already saved\" logic in the `JdbcMessageStore`s via `DuplicateKeyException` on the `INSERT`.\r\nThis is much effective then additional `SELECT` in case of `SAVED` before\r\n* Control \"already saved\" logic in the  `AbstractConfigurableMongoDbMessageStore` via `DuplicateKeyException` on the `INSERT`.\r\nSince `MongoDbMessageStore` doesn't provide extra `messageId` field, perform extra `SELECT` before store document.\r\nAnyway the `MongoDbMessageStore` isn't recommended for use.\r\nWe may consider to deprecate it\r\n* Control \"already saved\" logic  in the `AbstractKeyValueMessageStore` via `putIfAbsent` operation\r\n\r\nWith this fix we persist message in the store as is without any modifications when we perform standard serialization procedure.\r\nAny custom serializers should consider to use `MutableMessageBuilder` if there is a requirement to retain `ID` and `TIMESTAMP`","created_at":"2016-09-29T22:57:43Z","updated_at":"2016-10-12T17:41:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"97684205c53c9384837ada8d3c093b9b1d8975a7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/spring-projects/spring-integration/pulls/1916/commits","review_comments_url":"https://api.github.com/repos/spring-projects/spring-integration/pulls/1916/comments","review_comment_url":"https://api.github.com/repos/spring-projects/spring-integration/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spring-projects/spring-integration/issues/1916/comments","statuses_url":"https://api.github.com/repos/spring-projects/spring-integration/statuses/b2a9ffae3b917de22f212f509d39fc0ae4c28916","head":{"label":"artembilan:INT-2460","ref":"INT-2460","sha":"b2a9ffae3b917de22f212f509d39fc0ae4c28916","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},"repo":{"id":2686240,"name":"spring-integration","full_name":"artembilan/spring-integration","owner":{"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},"private":false,"html_url":"https://github.com/artembilan/spring-integration","description":"","fork":true,"url":"https://api.github.com/repos/artembilan/spring-integration","forks_url":"https://api.github.com/repos/artembilan/spring-integration/forks","keys_url":"https://api.github.com/repos/artembilan/spring-integration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/artembilan/spring-integration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/artembilan/spring-integration/teams","hooks_url":"https://api.github.com/repos/artembilan/spring-integration/hooks","issue_events_url":"https://api.github.com/repos/artembilan/spring-integration/issues/events{/number}","events_url":"https://api.github.com/repos/artembilan/spring-integration/events","assignees_url":"https://api.github.com/repos/artembilan/spring-integration/assignees{/user}","branches_url":"https://api.github.com/repos/artembilan/spring-integration/branches{/branch}","tags_url":"https://api.github.com/repos/artembilan/spring-integration/tags","blobs_url":"https://api.github.com/repos/artembilan/spring-integration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/artembilan/spring-integration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/artembilan/spring-integration/git/refs{/sha}","trees_url":"https://api.github.com/repos/artembilan/spring-integration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/artembilan/spring-integration/statuses/{sha}","languages_url":"https://api.github.com/repos/artembilan/spring-integration/languages","stargazers_url":"https://api.github.com/repos/artembilan/spring-integration/stargazers","contributors_url":"https://api.github.com/repos/artembilan/spring-integration/contributors","subscribers_url":"https://api.github.com/repos/artembilan/spring-integration/subscribers","subscription_url":"https://api.github.com/repos/artembilan/spring-integration/subscription","commits_url":"https://api.github.com/repos/artembilan/spring-integration/commits{/sha}","git_commits_url":"https://api.github.com/repos/artembilan/spring-integration/git/commits{/sha}","comments_url":"https://api.github.com/repos/artembilan/spring-integration/comments{/number}","issue_comment_url":"https://api.github.com/repos/artembilan/spring-integration/issues/comments{/number}","contents_url":"https://api.github.com/repos/artembilan/spring-integration/contents/{+path}","compare_url":"https://api.github.com/repos/artembilan/spring-integration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/artembilan/spring-integration/merges","archive_url":"https://api.github.com/repos/artembilan/spring-integration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/artembilan/spring-integration/downloads","issues_url":"https://api.github.com/repos/artembilan/spring-integration/issues{/number}","pulls_url":"https://api.github.com/repos/artembilan/spring-integration/pulls{/number}","milestones_url":"https://api.github.com/repos/artembilan/spring-integration/milestones{/number}","notifications_url":"https://api.github.com/repos/artembilan/spring-integration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/artembilan/spring-integration/labels{/name}","releases_url":"https://api.github.com/repos/artembilan/spring-integration/releases{/id}","deployments_url":"https://api.github.com/repos/artembilan/spring-integration/deployments","created_at":"2011-11-01T08:04:04Z","updated_at":"2015-05-08T08:40:43Z","pushed_at":"2016-10-12T16:03:31Z","git_url":"git://github.com/artembilan/spring-integration.git","ssh_url":"git@github.com:artembilan/spring-integration.git","clone_url":"https://github.com/artembilan/spring-integration.git","svn_url":"https://github.com/artembilan/spring-integration","homepage":"","size":40593,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"spring-projects:master","ref":"master","sha":"7c12288d2eabb05da94cb10cbbfca678d87b589c","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":2090979,"name":"spring-integration","full_name":"spring-projects/spring-integration","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-integration","description":"Spring Integration provides an extension of the Spring programming model to support the well-known Enterprise Integration Patterns (EIP)","fork":false,"url":"https://api.github.com/repos/spring-projects/spring-integration","forks_url":"https://api.github.com/repos/spring-projects/spring-integration/forks","keys_url":"https://api.github.com/repos/spring-projects/spring-integration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spring-projects/spring-integration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spring-projects/spring-integration/teams","hooks_url":"https://api.github.com/repos/spring-projects/spring-integration/hooks","issue_events_url":"https://api.github.com/repos/spring-projects/spring-integration/issues/events{/number}","events_url":"https://api.github.com/repos/spring-projects/spring-integration/events","assignees_url":"https://api.github.com/repos/spring-projects/spring-integration/assignees{/user}","branches_url":"https://api.github.com/repos/spring-projects/spring-integration/branches{/branch}","tags_url":"https://api.github.com/repos/spring-projects/spring-integration/tags","blobs_url":"https://api.github.com/repos/spring-projects/spring-integration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spring-projects/spring-integration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spring-projects/spring-integration/git/refs{/sha}","trees_url":"https://api.github.com/repos/spring-projects/spring-integration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spring-projects/spring-integration/statuses/{sha}","languages_url":"https://api.github.com/repos/spring-projects/spring-integration/languages","stargazers_url":"https://api.github.com/repos/spring-projects/spring-integration/stargazers","contributors_url":"https://api.github.com/repos/spring-projects/spring-integration/contributors","subscribers_url":"https://api.github.com/repos/spring-projects/spring-integration/subscribers","subscription_url":"https://api.github.com/repos/spring-projects/spring-integration/subscription","commits_url":"https://api.github.com/repos/spring-projects/spring-integration/commits{/sha}","git_commits_url":"https://api.github.com/repos/spring-projects/spring-integration/git/commits{/sha}","comments_url":"https://api.github.com/repos/spring-projects/spring-integration/comments{/number}","issue_comment_url":"https://api.github.com/repos/spring-projects/spring-integration/issues/comments{/number}","contents_url":"https://api.github.com/repos/spring-projects/spring-integration/contents/{+path}","compare_url":"https://api.github.com/repos/spring-projects/spring-integration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spring-projects/spring-integration/merges","archive_url":"https://api.github.com/repos/spring-projects/spring-integration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spring-projects/spring-integration/downloads","issues_url":"https://api.github.com/repos/spring-projects/spring-integration/issues{/number}","pulls_url":"https://api.github.com/repos/spring-projects/spring-integration/pulls{/number}","milestones_url":"https://api.github.com/repos/spring-projects/spring-integration/milestones{/number}","notifications_url":"https://api.github.com/repos/spring-projects/spring-integration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spring-projects/spring-integration/labels{/name}","releases_url":"https://api.github.com/repos/spring-projects/spring-integration/releases{/id}","deployments_url":"https://api.github.com/repos/spring-projects/spring-integration/deployments","created_at":"2011-07-22T21:47:27Z","updated_at":"2016-10-07T16:12:44Z","pushed_at":"2016-10-12T16:03:32Z","git_url":"git://github.com/spring-projects/spring-integration.git","ssh_url":"git@github.com:spring-projects/spring-integration.git","clone_url":"https://github.com/spring-projects/spring-integration.git","svn_url":"https://github.com/spring-projects/spring-integration","homepage":"http://projects.spring.io/spring-integration/","size":52767,"stargazers_count":508,"watchers_count":508,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":452,"mirror_url":null,"open_issues_count":4,"forks":452,"open_issues":4,"watchers":508,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spring-projects/spring-integration/pulls/1916"},"html":{"href":"https://github.com/spring-projects/spring-integration/pull/1916"},"issue":{"href":"https://api.github.com/repos/spring-projects/spring-integration/issues/1916"},"comments":{"href":"https://api.github.com/repos/spring-projects/spring-integration/issues/1916/comments"},"review_comments":{"href":"https://api.github.com/repos/spring-projects/spring-integration/pulls/1916/comments"},"review_comment":{"href":"https://api.github.com/repos/spring-projects/spring-integration/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spring-projects/spring-integration/pulls/1916/commits"},"statuses":{"href":"https://api.github.com/repos/spring-projects/spring-integration/statuses/b2a9ffae3b917de22f212f509d39fc0ae4c28916"}}}}
{"actor":{"display_login":"garyrussell"}}