diff --git a/flexible/pubsub/src/main/java/com/example/flexible/pubsub/PubSubPublish.java b/flexible/pubsub/src/main/java/com/example/flexible/pubsub/PubSubPublish.java index 08893841110..f987529b46e 100644 --- a/flexible/pubsub/src/main/java/com/example/flexible/pubsub/PubSubPublish.java +++ b/flexible/pubsub/src/main/java/com/example/flexible/pubsub/PubSubPublish.java @@ -27,7 +27,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -// [START publish] +// [START pubsub_appengine_flex_publish] @WebServlet(name = "Publish with PubSub", value = "/pubsub/publish") public class PubSubPublish extends HttpServlet { @@ -55,7 +55,7 @@ public void doPost(HttpServletRequest req, HttpServletResponse resp) resp.sendError(HttpStatus.SC_INTERNAL_SERVER_ERROR, e.getMessage()); } } -// [END publish] +// [END pubsub_appengine_flex_publish] private Publisher publisher; diff --git a/flexible/pubsub/src/main/java/com/example/flexible/pubsub/PubSubPush.java b/flexible/pubsub/src/main/java/com/example/flexible/pubsub/PubSubPush.java index ce47254e7aa..75f8dc5595d 100644 --- a/flexible/pubsub/src/main/java/com/example/flexible/pubsub/PubSubPush.java +++ b/flexible/pubsub/src/main/java/com/example/flexible/pubsub/PubSubPush.java @@ -26,7 +26,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -// [START push] +// [START pubsub_appengine_flex_push] @WebServlet(value = "/pubsub/push") public class PubSubPush extends HttpServlet { @@ -50,7 +50,7 @@ public void doPost(HttpServletRequest req, HttpServletResponse resp) resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } -// [END push] +// [END pubsub_appengine_flex_push] private Message getMessage(HttpServletRequest request) throws IOException { String requestBody = request.getReader().lines().collect(Collectors.joining("\n"));