{"action":"created","comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/pulls/comments/118577879","pull_request_review_id":40384460,"id":118577879,"diff_hunk":"@@ -16,47 +16,28 @@\n \n package org.springframework.cloud.gcp.pubsub.integration.outbound;\n \n-import com.google.cloud.pubsub.spi.v1.Publisher;\n-import com.google.pubsub.v1.PubsubMessage;\n-import com.google.pubsub.v1.TopicName;\n import java.io.IOException;\n-import org.springframework.cloud.gcp.pubsub.integration.converters.SimpleMessageConverter;\n+import org.springframework.cloud.gcp.pubsub.core.PubSubTemplate;\n import org.springframework.integration.handler.AbstractMessageHandler;\n import org.springframework.messaging.Message;\n-import org.springframework.messaging.converter.MessageConversionException;\n-import org.springframework.messaging.converter.MessageConverter;\n \n /**\n- * Converts from internal Spring message to GCP Pub/Sub message and publishes the Pub/Sub\n- * message to a Pub/Sub topic.\n+ * Sends messages to Google Cloud Pub/Sub by delegating to {@link PubSubTemplate}.\n  *\n  * @author João André Martins\n  */\n public class PubSubMessageHandler extends AbstractMessageHandler {\n \n-  private Publisher publisher;\n-  private MessageConverter messageConverter;\n+  private PubSubTemplate pubsubTemplate;\n+  private String topic;\n \n-  public PubSubMessageHandler(String projectId, String topicName) throws IOException {\n-    this(projectId, topicName, new SimpleMessageConverter());\n-  }\n-\n-  public PubSubMessageHandler(String projectId, String topicName,\n-      MessageConverter messageConverter) throws IOException {\n-    publisher = Publisher.defaultBuilder(TopicName.create(\n-        projectId, topicName)).build();\n-    this.messageConverter = messageConverter;\n+  public PubSubMessageHandler(String projectId, String topic) throws IOException {\n+    pubsubTemplate = new PubSubTemplate(null, projectId);\n+    this.topic = topic;","path":"spring-cloud-gcp-pubsub/src/main/java/org/springframework/cloud/gcp/pubsub/integration/outbound/PubSubMessageHandler.java","position":40,"original_position":40,"commit_id":"a379cc599773c86a402b0a6b365331c8bdc39e7f","original_commit_id":"a379cc599773c86a402b0a6b365331c8bdc39e7f","user":{"login":"joaoandremartins","id":3290856,"avatar_url":"https://avatars3.githubusercontent.com/u/3290856?v=3","gravatar_id":"","url":"https://api.github.com/users/joaoandremartins","html_url":"https://github.com/joaoandremartins","followers_url":"https://api.github.com/users/joaoandremartins/followers","following_url":"https://api.github.com/users/joaoandremartins/following{/other_user}","gists_url":"https://api.github.com/users/joaoandremartins/gists{/gist_id}","starred_url":"https://api.github.com/users/joaoandremartins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joaoandremartins/subscriptions","organizations_url":"https://api.github.com/users/joaoandremartins/orgs","repos_url":"https://api.github.com/users/joaoandremartins/repos","events_url":"https://api.github.com/users/joaoandremartins/events{/privacy}","received_events_url":"https://api.github.com/users/joaoandremartins/received_events","type":"User","site_admin":false},"body":"Thanks a lot for the explanation, it's a lot clearer now.\r\n\r\nFrom my point of view, I think it would be great to focus on landing the work on everything SI needs to operate right now, and file non-SI use cases as issue that we could address later.","created_at":"2017-05-25T20:31:51Z","updated_at":"2017-05-25T20:31:51Z","html_url":"https://github.com/spring-cloud/spring-cloud-gcp/pull/14#discussion_r118577879","pull_request_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/pulls/comments/118577879"},"html":{"href":"https://github.com/spring-cloud/spring-cloud-gcp/pull/14#discussion_r118577879"},"pull_request":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/pulls/14","id":122326534,"html_url":"https://github.com/spring-cloud/spring-cloud-gcp/pull/14","diff_url":"https://github.com/spring-cloud/spring-cloud-gcp/pull/14.diff","patch_url":"https://github.com/spring-cloud/spring-cloud-gcp/pull/14.patch","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/issues/14","number":14,"state":"closed","locked":false,"title":"Makes PubSubMessageHandler use PubSubTemplate","user":{"login":"joaoandremartins","id":3290856,"avatar_url":"https://avatars3.githubusercontent.com/u/3290856?v=3","gravatar_id":"","url":"https://api.github.com/users/joaoandremartins","html_url":"https://github.com/joaoandremartins","followers_url":"https://api.github.com/users/joaoandremartins/followers","following_url":"https://api.github.com/users/joaoandremartins/following{/other_user}","gists_url":"https://api.github.com/users/joaoandremartins/gists{/gist_id}","starred_url":"https://api.github.com/users/joaoandremartins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joaoandremartins/subscriptions","organizations_url":"https://api.github.com/users/joaoandremartins/orgs","repos_url":"https://api.github.com/users/joaoandremartins/repos","events_url":"https://api.github.com/users/joaoandremartins/events{/privacy}","received_events_url":"https://api.github.com/users/joaoandremartins/received_events","type":"User","site_admin":false},"body":"Partially addresses https://github.com/spring-cloud/spring-cloud-gcp/issues/10","created_at":"2017-05-24T21:21:16Z","updated_at":"2017-05-25T20:31:51Z","closed_at":"2017-05-25T00:15:03Z","merged_at":null,"merge_commit_sha":"5eae80d6f66efbeaf933f08ba04bbf02148b1fce","assignee":null,"assignees":[],"requested_reviewers":[{"login":"viniciusccarvalho","id":803893,"avatar_url":"https://avatars0.githubusercontent.com/u/803893?v=3","gravatar_id":"","url":"https://api.github.com/users/viniciusccarvalho","html_url":"https://github.com/viniciusccarvalho","followers_url":"https://api.github.com/users/viniciusccarvalho/followers","following_url":"https://api.github.com/users/viniciusccarvalho/following{/other_user}","gists_url":"https://api.github.com/users/viniciusccarvalho/gists{/gist_id}","starred_url":"https://api.github.com/users/viniciusccarvalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viniciusccarvalho/subscriptions","organizations_url":"https://api.github.com/users/viniciusccarvalho/orgs","repos_url":"https://api.github.com/users/viniciusccarvalho/repos","events_url":"https://api.github.com/users/viniciusccarvalho/events{/privacy}","received_events_url":"https://api.github.com/users/viniciusccarvalho/received_events","type":"User","site_admin":false},{"login":"meltsufin","id":17732492,"avatar_url":"https://avatars1.githubusercontent.com/u/17732492?v=3","gravatar_id":"","url":"https://api.github.com/users/meltsufin","html_url":"https://github.com/meltsufin","followers_url":"https://api.github.com/users/meltsufin/followers","following_url":"https://api.github.com/users/meltsufin/following{/other_user}","gists_url":"https://api.github.com/users/meltsufin/gists{/gist_id}","starred_url":"https://api.github.com/users/meltsufin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meltsufin/subscriptions","organizations_url":"https://api.github.com/users/meltsufin/orgs","repos_url":"https://api.github.com/users/meltsufin/repos","events_url":"https://api.github.com/users/meltsufin/events{/privacy}","received_events_url":"https://api.github.com/users/meltsufin/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/pulls/14/commits","review_comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/pulls/14/comments","review_comment_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/issues/14/comments","statuses_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/statuses/a379cc599773c86a402b0a6b365331c8bdc39e7f","head":{"label":"joaoandremartins:handler-uses-template","ref":"handler-uses-template","sha":"a379cc599773c86a402b0a6b365331c8bdc39e7f","user":{"login":"joaoandremartins","id":3290856,"avatar_url":"https://avatars3.githubusercontent.com/u/3290856?v=3","gravatar_id":"","url":"https://api.github.com/users/joaoandremartins","html_url":"https://github.com/joaoandremartins","followers_url":"https://api.github.com/users/joaoandremartins/followers","following_url":"https://api.github.com/users/joaoandremartins/following{/other_user}","gists_url":"https://api.github.com/users/joaoandremartins/gists{/gist_id}","starred_url":"https://api.github.com/users/joaoandremartins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joaoandremartins/subscriptions","organizations_url":"https://api.github.com/users/joaoandremartins/orgs","repos_url":"https://api.github.com/users/joaoandremartins/repos","events_url":"https://api.github.com/users/joaoandremartins/events{/privacy}","received_events_url":"https://api.github.com/users/joaoandremartins/received_events","type":"User","site_admin":false},"repo":{"id":92334738,"name":"spring-cloud-gcp","full_name":"joaoandremartins/spring-cloud-gcp","owner":{"login":"joaoandremartins","id":3290856,"avatar_url":"https://avatars3.githubusercontent.com/u/3290856?v=3","gravatar_id":"","url":"https://api.github.com/users/joaoandremartins","html_url":"https://github.com/joaoandremartins","followers_url":"https://api.github.com/users/joaoandremartins/followers","following_url":"https://api.github.com/users/joaoandremartins/following{/other_user}","gists_url":"https://api.github.com/users/joaoandremartins/gists{/gist_id}","starred_url":"https://api.github.com/users/joaoandremartins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joaoandremartins/subscriptions","organizations_url":"https://api.github.com/users/joaoandremartins/orgs","repos_url":"https://api.github.com/users/joaoandremartins/repos","events_url":"https://api.github.com/users/joaoandremartins/events{/privacy}","received_events_url":"https://api.github.com/users/joaoandremartins/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joaoandremartins/spring-cloud-gcp","description":"Integration for Google Cloud Platform APIs with Spring","fork":true,"url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp","forks_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/forks","keys_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/teams","hooks_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/hooks","issue_events_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/issues/events{/number}","events_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/events","assignees_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/assignees{/user}","branches_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/branches{/branch}","tags_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/tags","blobs_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/git/refs{/sha}","trees_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/statuses/{sha}","languages_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/languages","stargazers_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/stargazers","contributors_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/contributors","subscribers_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/subscribers","subscription_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/subscription","commits_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/commits{/sha}","git_commits_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/git/commits{/sha}","comments_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/comments{/number}","issue_comment_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/issues/comments{/number}","contents_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/contents/{+path}","compare_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/merges","archive_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/downloads","issues_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/issues{/number}","pulls_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/pulls{/number}","milestones_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/milestones{/number}","notifications_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/labels{/name}","releases_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/releases{/id}","deployments_url":"https://api.github.com/repos/joaoandremartins/spring-cloud-gcp/deployments","created_at":"2017-05-24T20:42:13Z","updated_at":"2017-05-24T20:42:15Z","pushed_at":"2017-05-24T21:19:06Z","git_url":"git://github.com/joaoandremartins/spring-cloud-gcp.git","ssh_url":"git@github.com:joaoandremartins/spring-cloud-gcp.git","clone_url":"https://github.com/joaoandremartins/spring-cloud-gcp.git","svn_url":"https://github.com/joaoandremartins/spring-cloud-gcp","homepage":null,"size":60,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spring-cloud:pubsub-si-channel-adapters","ref":"pubsub-si-channel-adapters","sha":"a8e1242962f047ba7453cad89c167acfa62f1042","user":{"login":"spring-cloud","id":7815877,"avatar_url":"https://avatars3.githubusercontent.com/u/7815877?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-cloud","html_url":"https://github.com/spring-cloud","followers_url":"https://api.github.com/users/spring-cloud/followers","following_url":"https://api.github.com/users/spring-cloud/following{/other_user}","gists_url":"https://api.github.com/users/spring-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-cloud/subscriptions","organizations_url":"https://api.github.com/users/spring-cloud/orgs","repos_url":"https://api.github.com/users/spring-cloud/repos","events_url":"https://api.github.com/users/spring-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/spring-cloud/received_events","type":"Organization","site_admin":false},"repo":{"id":86105877,"name":"spring-cloud-gcp","full_name":"spring-cloud/spring-cloud-gcp","owner":{"login":"spring-cloud","id":7815877,"avatar_url":"https://avatars3.githubusercontent.com/u/7815877?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-cloud","html_url":"https://github.com/spring-cloud","followers_url":"https://api.github.com/users/spring-cloud/followers","following_url":"https://api.github.com/users/spring-cloud/following{/other_user}","gists_url":"https://api.github.com/users/spring-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-cloud/subscriptions","organizations_url":"https://api.github.com/users/spring-cloud/orgs","repos_url":"https://api.github.com/users/spring-cloud/repos","events_url":"https://api.github.com/users/spring-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/spring-cloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spring-cloud/spring-cloud-gcp","description":"Integration for Google Cloud Platform APIs with Spring","fork":false,"url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp","forks_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/forks","keys_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/teams","hooks_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/hooks","issue_events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/issues/events{/number}","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/events","assignees_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/assignees{/user}","branches_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/branches{/branch}","tags_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/tags","blobs_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/git/refs{/sha}","trees_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/statuses/{sha}","languages_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/languages","stargazers_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/stargazers","contributors_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/contributors","subscribers_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/subscribers","subscription_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/subscription","commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/commits{/sha}","git_commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/git/commits{/sha}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/comments{/number}","issue_comment_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/issues/comments{/number}","contents_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/contents/{+path}","compare_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/merges","archive_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/downloads","issues_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/issues{/number}","pulls_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/pulls{/number}","milestones_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/milestones{/number}","notifications_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/labels{/name}","releases_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/releases{/id}","deployments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/deployments","created_at":"2017-03-24T19:58:20Z","updated_at":"2017-05-15T20:22:10Z","pushed_at":"2017-05-25T19:48:21Z","git_url":"git://github.com/spring-cloud/spring-cloud-gcp.git","ssh_url":"git@github.com:spring-cloud/spring-cloud-gcp.git","clone_url":"https://github.com/spring-cloud/spring-cloud-gcp.git","svn_url":"https://github.com/spring-cloud/spring-cloud-gcp","homepage":null,"size":53,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":13,"forks":5,"open_issues":13,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/pulls/14"},"html":{"href":"https://github.com/spring-cloud/spring-cloud-gcp/pull/14"},"issue":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/issues/14"},"comments":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-gcp/statuses/a379cc599773c86a402b0a6b365331c8bdc39e7f"}}}}
{"actor":{"display_login":"joaoandremartins"}}