{"action":"created","comment":{"url":"https://api.github.com/repos/zalando/nakadi/pulls/comments/72214489","id":72214489,"diff_hunk":"@@ -606,22 +488,388 @@ paths:\n           description: Partition id\n           type: string\n           required: true\n-        - name: X-Flow-Id\n+        - $ref: '#/parameters/XFlowId'\n+      responses:\n+        '200':\n+          description: OK\n+          schema:\n+            $ref: '#/definitions/Partition'\n+        '401':\n+          description: Client is not authenticated\n+          schema:\n+            $ref: '#/definitions/Problem'\n+\n+  /subscriptions:\n+    post:\n+      tags:\n+        - managed-api\n+      security:\n+        - oauth2: ['nakadi.event_stream.read']\n+      description: |\n+        This endpoint creates a subscription for EventTypes. The subscription is needed to be able to\n+        consume events from EventTypes in a high level way when Nakadi stores the offsets and manages the\n+        rebalancing of consuming clients.\n+        The subscription is identified by its key parameters (owning_application, event_types, consumer_group). If\n+        this endpoint is invoked several times with the same key subscription properties in body - the\n+        subscription will be created only once and for all other calls it will just return the subscription\n+        that was already created.\n+      parameters:\n+        - name: subscription\n+          in: body\n+          description: Subscription to create\n+          schema:\n+            $ref: '#/definitions/Subscription'\n+          required: true\n+      responses:\n+        '200':\n+          description: |\n+            Subscription for such parameters already exists. Returns subscription object that already\n+            existed.\n+          schema:\n+            $ref: '#/definitions/Subscription'\n+        '201':\n+          description: Subscription was successfuly created. Returns subscription object that was created.\n+          schema:\n+            $ref: '#/definitions/Subscription'","path":"api/nakadi-event-bus-api.yaml","position":289,"original_position":289,"commit_id":"b8bf6ab2c2bf7ace1e1a1ebbafd320d6ac7011a6","original_commit_id":"b8bf6ab2c2bf7ace1e1a1ebbafd320d6ac7011a6","user":{"login":"ePaul","id":645859,"avatar_url":"https://avatars.githubusercontent.com/u/645859?v=3","gravatar_id":"","url":"https://api.github.com/users/ePaul","html_url":"https://github.com/ePaul","followers_url":"https://api.github.com/users/ePaul/followers","following_url":"https://api.github.com/users/ePaul/following{/other_user}","gists_url":"https://api.github.com/users/ePaul/gists{/gist_id}","starred_url":"https://api.github.com/users/ePaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ePaul/subscriptions","organizations_url":"https://api.github.com/users/ePaul/orgs","repos_url":"https://api.github.com/users/ePaul/repos","events_url":"https://api.github.com/users/ePaul/events{/privacy}","received_events_url":"https://api.github.com/users/ePaul/received_events","type":"User","site_admin":false},"body":"Both 200 and 201 should include a Content-Location header with the URI of the existing subscription (and a Location header with the same info, at least for 201).","created_at":"2016-07-26T09:18:18Z","updated_at":"2016-07-26T09:18:18Z","html_url":"https://github.com/zalando/nakadi/pull/353#discussion_r72214489","pull_request_url":"https://api.github.com/repos/zalando/nakadi/pulls/353","_links":{"self":{"href":"https://api.github.com/repos/zalando/nakadi/pulls/comments/72214489"},"html":{"href":"https://github.com/zalando/nakadi/pull/353#discussion_r72214489"},"pull_request":{"href":"https://api.github.com/repos/zalando/nakadi/pulls/353"}}},"pull_request":{"url":"https://api.github.com/repos/zalando/nakadi/pulls/353","id":78153723,"html_url":"https://github.com/zalando/nakadi/pull/353","diff_url":"https://github.com/zalando/nakadi/pull/353.diff","patch_url":"https://github.com/zalando/nakadi/pull/353.patch","issue_url":"https://api.github.com/repos/zalando/nakadi/issues/353","number":353,"state":"open","locked":false,"title":"Feature/aruha 190 subscription api","user":{"login":"rcillo","id":344648,"avatar_url":"https://avatars.githubusercontent.com/u/344648?v=3","gravatar_id":"","url":"https://api.github.com/users/rcillo","html_url":"https://github.com/rcillo","followers_url":"https://api.github.com/users/rcillo/followers","following_url":"https://api.github.com/users/rcillo/following{/other_user}","gists_url":"https://api.github.com/users/rcillo/gists{/gist_id}","starred_url":"https://api.github.com/users/rcillo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcillo/subscriptions","organizations_url":"https://api.github.com/users/rcillo/orgs","repos_url":"https://api.github.com/users/rcillo/repos","events_url":"https://api.github.com/users/rcillo/events{/privacy}","received_events_url":"https://api.github.com/users/rcillo/received_events","type":"User","site_admin":false},"body":"Clients streaming through a subscription do not need to handle offsets persistence or partitions assignment. The workflow is very simple:\r\n\r\n1. First client creates a subscription\r\n2. This client starts streaming from this subscription (which automatically assigns all partitions to it)\r\n3. A new client is launched and tries to create the same subscription\r\n4. Since subscription creation is idempotent, it gets a reference to the existing subscription\r\n5. The new client starts streaming from this subscription, which causes partitions to be reassigned (rebalanced) between clients.\r\n6. Repeat 3-5 until you have as many clients as partitions.\r\n\r\nSubscriptions also provide a mechanism for implementing backpressure using a window size strategy.","created_at":"2016-07-20T14:09:56Z","updated_at":"2016-07-26T09:18:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"013d8d7c759dda62d2854dd4c356ba41ca2ecc68","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/zalando/nakadi/pulls/353/commits","review_comments_url":"https://api.github.com/repos/zalando/nakadi/pulls/353/comments","review_comment_url":"https://api.github.com/repos/zalando/nakadi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zalando/nakadi/issues/353/comments","statuses_url":"https://api.github.com/repos/zalando/nakadi/statuses/b8bf6ab2c2bf7ace1e1a1ebbafd320d6ac7011a6","head":{"label":"zalando:feature/ARUHA-190-subscription-api","ref":"feature/ARUHA-190-subscription-api","sha":"b8bf6ab2c2bf7ace1e1a1ebbafd320d6ac7011a6","user":{"login":"zalando","id":1564818,"avatar_url":"https://avatars.githubusercontent.com/u/1564818?v=3","gravatar_id":"","url":"https://api.github.com/users/zalando","html_url":"https://github.com/zalando","followers_url":"https://api.github.com/users/zalando/followers","following_url":"https://api.github.com/users/zalando/following{/other_user}","gists_url":"https://api.github.com/users/zalando/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando/subscriptions","organizations_url":"https://api.github.com/users/zalando/orgs","repos_url":"https://api.github.com/users/zalando/repos","events_url":"https://api.github.com/users/zalando/events{/privacy}","received_events_url":"https://api.github.com/users/zalando/received_events","type":"Organization","site_admin":false},"repo":{"id":44234368,"name":"nakadi","full_name":"zalando/nakadi","owner":{"login":"zalando","id":1564818,"avatar_url":"https://avatars.githubusercontent.com/u/1564818?v=3","gravatar_id":"","url":"https://api.github.com/users/zalando","html_url":"https://github.com/zalando","followers_url":"https://api.github.com/users/zalando/followers","following_url":"https://api.github.com/users/zalando/following{/other_user}","gists_url":"https://api.github.com/users/zalando/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando/subscriptions","organizations_url":"https://api.github.com/users/zalando/orgs","repos_url":"https://api.github.com/users/zalando/repos","events_url":"https://api.github.com/users/zalando/events{/privacy}","received_events_url":"https://api.github.com/users/zalando/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zalando/nakadi","description":"A distributed event bus that implements a RESTful API abstraction instead of Kafka-like queues","fork":false,"url":"https://api.github.com/repos/zalando/nakadi","forks_url":"https://api.github.com/repos/zalando/nakadi/forks","keys_url":"https://api.github.com/repos/zalando/nakadi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zalando/nakadi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zalando/nakadi/teams","hooks_url":"https://api.github.com/repos/zalando/nakadi/hooks","issue_events_url":"https://api.github.com/repos/zalando/nakadi/issues/events{/number}","events_url":"https://api.github.com/repos/zalando/nakadi/events","assignees_url":"https://api.github.com/repos/zalando/nakadi/assignees{/user}","branches_url":"https://api.github.com/repos/zalando/nakadi/branches{/branch}","tags_url":"https://api.github.com/repos/zalando/nakadi/tags","blobs_url":"https://api.github.com/repos/zalando/nakadi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zalando/nakadi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zalando/nakadi/git/refs{/sha}","trees_url":"https://api.github.com/repos/zalando/nakadi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zalando/nakadi/statuses/{sha}","languages_url":"https://api.github.com/repos/zalando/nakadi/languages","stargazers_url":"https://api.github.com/repos/zalando/nakadi/stargazers","contributors_url":"https://api.github.com/repos/zalando/nakadi/contributors","subscribers_url":"https://api.github.com/repos/zalando/nakadi/subscribers","subscription_url":"https://api.github.com/repos/zalando/nakadi/subscription","commits_url":"https://api.github.com/repos/zalando/nakadi/commits{/sha}","git_commits_url":"https://api.github.com/repos/zalando/nakadi/git/commits{/sha}","comments_url":"https://api.github.com/repos/zalando/nakadi/comments{/number}","issue_comment_url":"https://api.github.com/repos/zalando/nakadi/issues/comments{/number}","contents_url":"https://api.github.com/repos/zalando/nakadi/contents/{+path}","compare_url":"https://api.github.com/repos/zalando/nakadi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zalando/nakadi/merges","archive_url":"https://api.github.com/repos/zalando/nakadi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zalando/nakadi/downloads","issues_url":"https://api.github.com/repos/zalando/nakadi/issues{/number}","pulls_url":"https://api.github.com/repos/zalando/nakadi/pulls{/number}","milestones_url":"https://api.github.com/repos/zalando/nakadi/milestones{/number}","notifications_url":"https://api.github.com/repos/zalando/nakadi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zalando/nakadi/labels{/name}","releases_url":"https://api.github.com/repos/zalando/nakadi/releases{/id}","deployments_url":"https://api.github.com/repos/zalando/nakadi/deployments","created_at":"2015-10-14T08:30:17Z","updated_at":"2016-07-20T21:40:23Z","pushed_at":"2016-07-25T15:59:57Z","git_url":"git://github.com/zalando/nakadi.git","ssh_url":"git@github.com:zalando/nakadi.git","clone_url":"https://github.com/zalando/nakadi.git","svn_url":"https://github.com/zalando/nakadi","homepage":"","size":3365,"stargazers_count":27,"watchers_count":27,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":5,"forks":20,"open_issues":5,"watchers":27,"default_branch":"nakadi-jvm"}},"base":{"label":"zalando:nakadi-jvm","ref":"nakadi-jvm","sha":"332e8a2892a2def86d1de236eaffd37b1a686a1a","user":{"login":"zalando","id":1564818,"avatar_url":"https://avatars.githubusercontent.com/u/1564818?v=3","gravatar_id":"","url":"https://api.github.com/users/zalando","html_url":"https://github.com/zalando","followers_url":"https://api.github.com/users/zalando/followers","following_url":"https://api.github.com/users/zalando/following{/other_user}","gists_url":"https://api.github.com/users/zalando/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando/subscriptions","organizations_url":"https://api.github.com/users/zalando/orgs","repos_url":"https://api.github.com/users/zalando/repos","events_url":"https://api.github.com/users/zalando/events{/privacy}","received_events_url":"https://api.github.com/users/zalando/received_events","type":"Organization","site_admin":false},"repo":{"id":44234368,"name":"nakadi","full_name":"zalando/nakadi","owner":{"login":"zalando","id":1564818,"avatar_url":"https://avatars.githubusercontent.com/u/1564818?v=3","gravatar_id":"","url":"https://api.github.com/users/zalando","html_url":"https://github.com/zalando","followers_url":"https://api.github.com/users/zalando/followers","following_url":"https://api.github.com/users/zalando/following{/other_user}","gists_url":"https://api.github.com/users/zalando/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando/subscriptions","organizations_url":"https://api.github.com/users/zalando/orgs","repos_url":"https://api.github.com/users/zalando/repos","events_url":"https://api.github.com/users/zalando/events{/privacy}","received_events_url":"https://api.github.com/users/zalando/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zalando/nakadi","description":"A distributed event bus that implements a RESTful API abstraction instead of Kafka-like queues","fork":false,"url":"https://api.github.com/repos/zalando/nakadi","forks_url":"https://api.github.com/repos/zalando/nakadi/forks","keys_url":"https://api.github.com/repos/zalando/nakadi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zalando/nakadi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zalando/nakadi/teams","hooks_url":"https://api.github.com/repos/zalando/nakadi/hooks","issue_events_url":"https://api.github.com/repos/zalando/nakadi/issues/events{/number}","events_url":"https://api.github.com/repos/zalando/nakadi/events","assignees_url":"https://api.github.com/repos/zalando/nakadi/assignees{/user}","branches_url":"https://api.github.com/repos/zalando/nakadi/branches{/branch}","tags_url":"https://api.github.com/repos/zalando/nakadi/tags","blobs_url":"https://api.github.com/repos/zalando/nakadi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zalando/nakadi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zalando/nakadi/git/refs{/sha}","trees_url":"https://api.github.com/repos/zalando/nakadi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zalando/nakadi/statuses/{sha}","languages_url":"https://api.github.com/repos/zalando/nakadi/languages","stargazers_url":"https://api.github.com/repos/zalando/nakadi/stargazers","contributors_url":"https://api.github.com/repos/zalando/nakadi/contributors","subscribers_url":"https://api.github.com/repos/zalando/nakadi/subscribers","subscription_url":"https://api.github.com/repos/zalando/nakadi/subscription","commits_url":"https://api.github.com/repos/zalando/nakadi/commits{/sha}","git_commits_url":"https://api.github.com/repos/zalando/nakadi/git/commits{/sha}","comments_url":"https://api.github.com/repos/zalando/nakadi/comments{/number}","issue_comment_url":"https://api.github.com/repos/zalando/nakadi/issues/comments{/number}","contents_url":"https://api.github.com/repos/zalando/nakadi/contents/{+path}","compare_url":"https://api.github.com/repos/zalando/nakadi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zalando/nakadi/merges","archive_url":"https://api.github.com/repos/zalando/nakadi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zalando/nakadi/downloads","issues_url":"https://api.github.com/repos/zalando/nakadi/issues{/number}","pulls_url":"https://api.github.com/repos/zalando/nakadi/pulls{/number}","milestones_url":"https://api.github.com/repos/zalando/nakadi/milestones{/number}","notifications_url":"https://api.github.com/repos/zalando/nakadi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zalando/nakadi/labels{/name}","releases_url":"https://api.github.com/repos/zalando/nakadi/releases{/id}","deployments_url":"https://api.github.com/repos/zalando/nakadi/deployments","created_at":"2015-10-14T08:30:17Z","updated_at":"2016-07-20T21:40:23Z","pushed_at":"2016-07-25T15:59:57Z","git_url":"git://github.com/zalando/nakadi.git","ssh_url":"git@github.com:zalando/nakadi.git","clone_url":"https://github.com/zalando/nakadi.git","svn_url":"https://github.com/zalando/nakadi","homepage":"","size":3365,"stargazers_count":27,"watchers_count":27,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":5,"forks":20,"open_issues":5,"watchers":27,"default_branch":"nakadi-jvm"}},"_links":{"self":{"href":"https://api.github.com/repos/zalando/nakadi/pulls/353"},"html":{"href":"https://github.com/zalando/nakadi/pull/353"},"issue":{"href":"https://api.github.com/repos/zalando/nakadi/issues/353"},"comments":{"href":"https://api.github.com/repos/zalando/nakadi/issues/353/comments"},"review_comments":{"href":"https://api.github.com/repos/zalando/nakadi/pulls/353/comments"},"review_comment":{"href":"https://api.github.com/repos/zalando/nakadi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zalando/nakadi/pulls/353/commits"},"statuses":{"href":"https://api.github.com/repos/zalando/nakadi/statuses/b8bf6ab2c2bf7ace1e1a1ebbafd320d6ac7011a6"}}}}
{"actor":{"display_login":"ePaul"}}