{"action":"created","comment":{"url":"https://api.github.com/repos/lagom/lagom-scala.g8/pulls/comments/118383625","pull_request_review_id":40170668,"id":118383625,"diff_hunk":"@@ -23,21 +29,41 @@ trait $name;format=\"Camel\"$Service extends Service {\n     */\n   def useGreeting(id: String): ServiceCall[GreetingMessage, Done]\n \n+\n+  /**\n+    * This gets published to Kafka.\n+    */\n+  def greetingsTopic(): Topic[GreetingMessage]\n+\n   override final def descriptor = {\n     import Service._\n     // @formatter:off\n-    named(\"$name;format=\"norm\"$\").withCalls(\n-      pathCall(\"/api/hello/:id\", hello _),\n-      pathCall(\"/api/hello/:id\", useGreeting _)\n-    ).withAutoAcl(true)\n+    named(\"$name;format=\"norm\"$\")\n+      .withCalls(\n+        pathCall(\"/api/hello/:id\", hello _),\n+        pathCall(\"/api/hello/:id\", useGreeting _)\n+      )\n+      .withTopics(\n+        topic($name;format=\"Camel\"$Service.TOPIC_NAME, greetingsTopic _)\n+          // Kafka partitions messages, messages within the same partition will\n+          // be delivered in order, to ensure that all messages for the same user\n+          // go to the same partition (and hence are delivered in order with respect\n+          // to that user), we configure a partition key strategy that extracts the\n+          // name as the partition key.\n+          .addProperty(\n+            KafkaProperties.partitionKeyStrategy,\n+            PartitionKeyStrategy[GreetingMessage](_.name)\n+          )\n+      )\n+      .withAutoAcl(true)\n     // @formatter:on\n   }\n }\n \n /**\n   * The greeting message class.\n   */\n-case class GreetingMessage(message: String)\n+case class GreetingMessage(name: String, message: String)","path":"$name__norm$-api/src/main/scala/$package$/api/$name__Camel$Service.scala","position":59,"original_position":59,"commit_id":"78b9711951073def83efed538ae87d92aef1f3ae","original_commit_id":"9bb2be2a76b915de4d61ab3c02f23e31ebd1bdad","user":{"login":"rcavalcanti","id":502982,"avatar_url":"https://avatars3.githubusercontent.com/u/502982?v=3","gravatar_id":"","url":"https://api.github.com/users/rcavalcanti","html_url":"https://github.com/rcavalcanti","followers_url":"https://api.github.com/users/rcavalcanti/followers","following_url":"https://api.github.com/users/rcavalcanti/following{/other_user}","gists_url":"https://api.github.com/users/rcavalcanti/gists{/gist_id}","starred_url":"https://api.github.com/users/rcavalcanti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcavalcanti/subscriptions","organizations_url":"https://api.github.com/users/rcavalcanti/orgs","repos_url":"https://api.github.com/users/rcavalcanti/repos","events_url":"https://api.github.com/users/rcavalcanti/events{/privacy}","received_events_url":"https://api.github.com/users/rcavalcanti/received_events","type":"User","site_admin":false},"body":"It's problematic to introduce the `name` here. This is the message that the user sends to the service (REST call). This was probably not an issue in Java because value is simply ignored and is probably set to `null`. \r\n\r\nIn Scala, the `play-json` will give an error. ","created_at":"2017-05-24T22:49:58Z","updated_at":"2017-05-24T22:49:58Z","html_url":"https://github.com/lagom/lagom-scala.g8/pull/10#discussion_r118383625","pull_request_url":"https://api.github.com/repos/lagom/lagom-scala.g8/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/lagom/lagom-scala.g8/pulls/comments/118383625"},"html":{"href":"https://github.com/lagom/lagom-scala.g8/pull/10#discussion_r118383625"},"pull_request":{"href":"https://api.github.com/repos/lagom/lagom-scala.g8/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/lagom/lagom-scala.g8/pulls/10","id":122335991,"html_url":"https://github.com/lagom/lagom-scala.g8/pull/10","diff_url":"https://github.com/lagom/lagom-scala.g8/pull/10.diff","patch_url":"https://github.com/lagom/lagom-scala.g8/pull/10.patch","issue_url":"https://api.github.com/repos/lagom/lagom-scala.g8/issues/10","number":10,"state":"open","locked":false,"title":"(WIP) - Added broker example","user":{"login":"rcavalcanti","id":502982,"avatar_url":"https://avatars3.githubusercontent.com/u/502982?v=3","gravatar_id":"","url":"https://api.github.com/users/rcavalcanti","html_url":"https://github.com/rcavalcanti","followers_url":"https://api.github.com/users/rcavalcanti/followers","following_url":"https://api.github.com/users/rcavalcanti/following{/other_user}","gists_url":"https://api.github.com/users/rcavalcanti/gists{/gist_id}","starred_url":"https://api.github.com/users/rcavalcanti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcavalcanti/subscriptions","organizations_url":"https://api.github.com/users/rcavalcanti/orgs","repos_url":"https://api.github.com/users/rcavalcanti/repos","events_url":"https://api.github.com/users/rcavalcanti/events{/privacy}","received_events_url":"https://api.github.com/users/rcavalcanti/received_events","type":"User","site_admin":false},"body":"This PR adds a broker example similar to what was added in the java version. \r\n\r\n(Please, don't merge it yet. I just realised that I introduced an error) ","created_at":"2017-05-24T22:20:12Z","updated_at":"2017-05-24T22:49:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1da7231766477c542e82b43af07f8bbb574e82b0","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jroper","id":105833,"avatar_url":"https://avatars3.githubusercontent.com/u/105833?v=3","gravatar_id":"","url":"https://api.github.com/users/jroper","html_url":"https://github.com/jroper","followers_url":"https://api.github.com/users/jroper/followers","following_url":"https://api.github.com/users/jroper/following{/other_user}","gists_url":"https://api.github.com/users/jroper/gists{/gist_id}","starred_url":"https://api.github.com/users/jroper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jroper/subscriptions","organizations_url":"https://api.github.com/users/jroper/orgs","repos_url":"https://api.github.com/users/jroper/repos","events_url":"https://api.github.com/users/jroper/events{/privacy}","received_events_url":"https://api.github.com/users/jroper/received_events","type":"User","site_admin":false},{"login":"ignasi35","id":762126,"avatar_url":"https://avatars1.githubusercontent.com/u/762126?v=3","gravatar_id":"","url":"https://api.github.com/users/ignasi35","html_url":"https://github.com/ignasi35","followers_url":"https://api.github.com/users/ignasi35/followers","following_url":"https://api.github.com/users/ignasi35/following{/other_user}","gists_url":"https://api.github.com/users/ignasi35/gists{/gist_id}","starred_url":"https://api.github.com/users/ignasi35/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ignasi35/subscriptions","organizations_url":"https://api.github.com/users/ignasi35/orgs","repos_url":"https://api.github.com/users/ignasi35/repos","events_url":"https://api.github.com/users/ignasi35/events{/privacy}","received_events_url":"https://api.github.com/users/ignasi35/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/lagom/lagom-scala.g8/pulls/10/commits","review_comments_url":"https://api.github.com/repos/lagom/lagom-scala.g8/pulls/10/comments","review_comment_url":"https://api.github.com/repos/lagom/lagom-scala.g8/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lagom/lagom-scala.g8/issues/10/comments","statuses_url":"https://api.github.com/repos/lagom/lagom-scala.g8/statuses/78b9711951073def83efed538ae87d92aef1f3ae","head":{"label":"rcavalcanti:master","ref":"master","sha":"78b9711951073def83efed538ae87d92aef1f3ae","user":{"login":"rcavalcanti","id":502982,"avatar_url":"https://avatars3.githubusercontent.com/u/502982?v=3","gravatar_id":"","url":"https://api.github.com/users/rcavalcanti","html_url":"https://github.com/rcavalcanti","followers_url":"https://api.github.com/users/rcavalcanti/followers","following_url":"https://api.github.com/users/rcavalcanti/following{/other_user}","gists_url":"https://api.github.com/users/rcavalcanti/gists{/gist_id}","starred_url":"https://api.github.com/users/rcavalcanti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcavalcanti/subscriptions","organizations_url":"https://api.github.com/users/rcavalcanti/orgs","repos_url":"https://api.github.com/users/rcavalcanti/repos","events_url":"https://api.github.com/users/rcavalcanti/events{/privacy}","received_events_url":"https://api.github.com/users/rcavalcanti/received_events","type":"User","site_admin":false},"repo":{"id":92288569,"name":"lagom-scala.g8","full_name":"rcavalcanti/lagom-scala.g8","owner":{"login":"rcavalcanti","id":502982,"avatar_url":"https://avatars3.githubusercontent.com/u/502982?v=3","gravatar_id":"","url":"https://api.github.com/users/rcavalcanti","html_url":"https://github.com/rcavalcanti","followers_url":"https://api.github.com/users/rcavalcanti/followers","following_url":"https://api.github.com/users/rcavalcanti/following{/other_user}","gists_url":"https://api.github.com/users/rcavalcanti/gists{/gist_id}","starred_url":"https://api.github.com/users/rcavalcanti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcavalcanti/subscriptions","organizations_url":"https://api.github.com/users/rcavalcanti/orgs","repos_url":"https://api.github.com/users/rcavalcanti/repos","events_url":"https://api.github.com/users/rcavalcanti/events{/privacy}","received_events_url":"https://api.github.com/users/rcavalcanti/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rcavalcanti/lagom-scala.g8","description":null,"fork":true,"url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8","forks_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/forks","keys_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/teams","hooks_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/hooks","issue_events_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/issues/events{/number}","events_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/events","assignees_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/assignees{/user}","branches_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/branches{/branch}","tags_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/tags","blobs_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/git/refs{/sha}","trees_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/statuses/{sha}","languages_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/languages","stargazers_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/stargazers","contributors_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/contributors","subscribers_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/subscribers","subscription_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/subscription","commits_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/commits{/sha}","git_commits_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/git/commits{/sha}","comments_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/comments{/number}","issue_comment_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/issues/comments{/number}","contents_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/contents/{+path}","compare_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/merges","archive_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/downloads","issues_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/issues{/number}","pulls_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/pulls{/number}","milestones_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/milestones{/number}","notifications_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/labels{/name}","releases_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/releases{/id}","deployments_url":"https://api.github.com/repos/rcavalcanti/lagom-scala.g8/deployments","created_at":"2017-05-24T12:14:07Z","updated_at":"2017-05-24T12:14:09Z","pushed_at":"2017-05-24T22:38:32Z","git_url":"git://github.com/rcavalcanti/lagom-scala.g8.git","ssh_url":"git@github.com:rcavalcanti/lagom-scala.g8.git","clone_url":"https://github.com/rcavalcanti/lagom-scala.g8.git","svn_url":"https://github.com/rcavalcanti/lagom-scala.g8","homepage":null,"size":23,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"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":"lagom:master","ref":"master","sha":"8241e2900e6d2ceae7d56865722ddbb29e1db633","user":{"login":"lagom","id":17168851,"avatar_url":"https://avatars2.githubusercontent.com/u/17168851?v=3","gravatar_id":"","url":"https://api.github.com/users/lagom","html_url":"https://github.com/lagom","followers_url":"https://api.github.com/users/lagom/followers","following_url":"https://api.github.com/users/lagom/following{/other_user}","gists_url":"https://api.github.com/users/lagom/gists{/gist_id}","starred_url":"https://api.github.com/users/lagom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lagom/subscriptions","organizations_url":"https://api.github.com/users/lagom/orgs","repos_url":"https://api.github.com/users/lagom/repos","events_url":"https://api.github.com/users/lagom/events{/privacy}","received_events_url":"https://api.github.com/users/lagom/received_events","type":"Organization","site_admin":false},"repo":{"id":75998877,"name":"lagom-scala.g8","full_name":"lagom/lagom-scala.g8","owner":{"login":"lagom","id":17168851,"avatar_url":"https://avatars2.githubusercontent.com/u/17168851?v=3","gravatar_id":"","url":"https://api.github.com/users/lagom","html_url":"https://github.com/lagom","followers_url":"https://api.github.com/users/lagom/followers","following_url":"https://api.github.com/users/lagom/following{/other_user}","gists_url":"https://api.github.com/users/lagom/gists{/gist_id}","starred_url":"https://api.github.com/users/lagom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lagom/subscriptions","organizations_url":"https://api.github.com/users/lagom/orgs","repos_url":"https://api.github.com/users/lagom/repos","events_url":"https://api.github.com/users/lagom/events{/privacy}","received_events_url":"https://api.github.com/users/lagom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lagom/lagom-scala.g8","description":null,"fork":false,"url":"https://api.github.com/repos/lagom/lagom-scala.g8","forks_url":"https://api.github.com/repos/lagom/lagom-scala.g8/forks","keys_url":"https://api.github.com/repos/lagom/lagom-scala.g8/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lagom/lagom-scala.g8/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lagom/lagom-scala.g8/teams","hooks_url":"https://api.github.com/repos/lagom/lagom-scala.g8/hooks","issue_events_url":"https://api.github.com/repos/lagom/lagom-scala.g8/issues/events{/number}","events_url":"https://api.github.com/repos/lagom/lagom-scala.g8/events","assignees_url":"https://api.github.com/repos/lagom/lagom-scala.g8/assignees{/user}","branches_url":"https://api.github.com/repos/lagom/lagom-scala.g8/branches{/branch}","tags_url":"https://api.github.com/repos/lagom/lagom-scala.g8/tags","blobs_url":"https://api.github.com/repos/lagom/lagom-scala.g8/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lagom/lagom-scala.g8/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lagom/lagom-scala.g8/git/refs{/sha}","trees_url":"https://api.github.com/repos/lagom/lagom-scala.g8/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lagom/lagom-scala.g8/statuses/{sha}","languages_url":"https://api.github.com/repos/lagom/lagom-scala.g8/languages","stargazers_url":"https://api.github.com/repos/lagom/lagom-scala.g8/stargazers","contributors_url":"https://api.github.com/repos/lagom/lagom-scala.g8/contributors","subscribers_url":"https://api.github.com/repos/lagom/lagom-scala.g8/subscribers","subscription_url":"https://api.github.com/repos/lagom/lagom-scala.g8/subscription","commits_url":"https://api.github.com/repos/lagom/lagom-scala.g8/commits{/sha}","git_commits_url":"https://api.github.com/repos/lagom/lagom-scala.g8/git/commits{/sha}","comments_url":"https://api.github.com/repos/lagom/lagom-scala.g8/comments{/number}","issue_comment_url":"https://api.github.com/repos/lagom/lagom-scala.g8/issues/comments{/number}","contents_url":"https://api.github.com/repos/lagom/lagom-scala.g8/contents/{+path}","compare_url":"https://api.github.com/repos/lagom/lagom-scala.g8/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lagom/lagom-scala.g8/merges","archive_url":"https://api.github.com/repos/lagom/lagom-scala.g8/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lagom/lagom-scala.g8/downloads","issues_url":"https://api.github.com/repos/lagom/lagom-scala.g8/issues{/number}","pulls_url":"https://api.github.com/repos/lagom/lagom-scala.g8/pulls{/number}","milestones_url":"https://api.github.com/repos/lagom/lagom-scala.g8/milestones{/number}","notifications_url":"https://api.github.com/repos/lagom/lagom-scala.g8/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lagom/lagom-scala.g8/labels{/name}","releases_url":"https://api.github.com/repos/lagom/lagom-scala.g8/releases{/id}","deployments_url":"https://api.github.com/repos/lagom/lagom-scala.g8/deployments","created_at":"2016-12-09T03:38:53Z","updated_at":"2017-05-11T04:33:16Z","pushed_at":"2017-05-24T22:38:33Z","git_url":"git://github.com/lagom/lagom-scala.g8.git","ssh_url":"git@github.com:lagom/lagom-scala.g8.git","clone_url":"https://github.com/lagom/lagom-scala.g8.git","svn_url":"https://github.com/lagom/lagom-scala.g8","homepage":null,"size":23,"stargazers_count":5,"watchers_count":5,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":1,"forks":8,"open_issues":1,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lagom/lagom-scala.g8/pulls/10"},"html":{"href":"https://github.com/lagom/lagom-scala.g8/pull/10"},"issue":{"href":"https://api.github.com/repos/lagom/lagom-scala.g8/issues/10"},"comments":{"href":"https://api.github.com/repos/lagom/lagom-scala.g8/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/lagom/lagom-scala.g8/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/lagom/lagom-scala.g8/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lagom/lagom-scala.g8/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/lagom/lagom-scala.g8/statuses/78b9711951073def83efed538ae87d92aef1f3ae"}}}}
{"actor":{"display_login":"rcavalcanti"}}