Skip to content

Commit

Permalink
Update translate/pubsub
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtisvg committed Mar 1, 2018
1 parent c0d769a commit 18c678d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.google.protobuf.ByteString;
import com.google.pubsub.v1.ProjectTopicName;
import com.google.pubsub.v1.PubsubMessage;
import com.google.pubsub.v1.TopicName;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import com.google.cloud.pubsub.v1.Publisher;
import com.google.gson.Gson;
import com.google.protobuf.ByteString;
import com.google.pubsub.v1.ProjectTopicName;
import com.google.pubsub.v1.PubsubMessage;
import com.google.pubsub.v1.TopicName;
import java.io.IOException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
Expand Down Expand Up @@ -56,7 +56,10 @@ public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOEx
// create a publisher on the topic
if (publisher == null) {
this.publisher = publisher = Publisher.newBuilder(
TopicName.of(ServiceOptions.getDefaultProjectId(), topicId))
ProjectTopicName.newBuilder()
.setProject(ServiceOptions.getDefaultProjectId())
.setTopic(topicId)
.build())
.build();
}

Expand Down

0 comments on commit 18c678d

Please sign in to comment.