{"id":114296,"date":"2022-07-18T07:00:00","date_gmt":"2022-07-18T04:00:00","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=114296"},"modified":"2022-07-04T16:44:08","modified_gmt":"2022-07-04T13:44:08","slug":"google-cloud-functions-2nd-gen-java-sample","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2022\/07\/google-cloud-functions-2nd-gen-java-sample.html","title":{"rendered":"Google Cloud Functions (2nd Gen) Java Sample"},"content":{"rendered":"<p><a href=\"https:\/\/cloud.google.com\/functions\/docs\/2nd-gen\/overview\" target=\"_blank\" rel=\"noopener\">Cloud Functions (2nd Gen)<\/a> is Google\u2019s Serverless Functions as a Service Platform. 2nd Generation is now built on top of the excellent <a href=\"https:\/\/cloud.google.com\/run\" target=\"_blank\" rel=\"noopener\">Google Cloud Run<\/a> as a base. Think of Google Cloud Run as a Serverless environment for running containers which respond to events(http being the most basic, all sorts of other events via <a href=\"https:\/\/cloud.google.com\/eventarc\/docs\/overview\" target=\"_blank\" rel=\"noopener\">eventarc<\/a>).<\/p>\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/image.png\"><img decoding=\"async\" width=\"1024\" height=\"552\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/image-1024x552.png\" alt=\"\" class=\"wp-image-114353\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/image-1024x552.png 1024w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/image-300x162.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/image-768x414.png 768w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/image-1536x828.png 1536w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/image.png 1600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<p>The blue area above shows the flow of code, the Google Cloud <a href=\"https:\/\/cloud.google.com\/sdk\/gcloud\/reference\/functions\/deploy\" target=\"_blank\" rel=\"noopener\">cli for Cloud Function<\/a>, orchestrates the flow where the source code is placed in Google Cloud Storage bucket, a Cloud Build is triggered to build this code, package it into a container and finally this container is run using Cloud Run which the user can access via Cloud Functions console. Cloud Functions essentially becomes a pass through to Cloud Run.<\/p>\n<p>The rest of this post will go into the details of how such a function can be written using Java.tl;dr \u2014 sample code is available <a href=\"https:\/\/github.com\/bijukunjummen\/http-cloudfunction-java-gradle\" target=\"_blank\" rel=\"noopener\">here<\/a> \u2014<a href=\"https:\/\/github.com\/bijukunjummen\/http-cloudfunction-java-gradle\">https:\/\/github.com\/bijukunjummen\/http-cloudfunction-java-gradle<\/a>, and has all the relevant pieces hooked up.<\/p>\n<h3 class=\"wp-block-heading\">Method Signature<\/h3>\n<p>To expose a function to respond to http events is fairly straightforward, it just needs to conform to the functions framework interface, for java it is available <a href=\"https:\/\/github.com\/GoogleCloudPlatform\/functions-framework-java\" target=\"_blank\" rel=\"noopener\">here<\/a> \u2014 <a href=\"https:\/\/github.com\/GoogleCloudPlatform\/functions-framework-java\">https:\/\/github.com\/GoogleCloudPlatform\/functions-framework-java<\/a><div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>To pull in this dependency using gradle as the build tool looks like this:<\/p>\n<div>\n<pre class=\"brush:java\">compileOnly(\"com.google.cloud.functions:functions-framework-api:1.0.4\")<\/pre>\n<\/div>\n<p>The dependency is required purely for compilation, at runtime the dependency is provided through a base image that Functions build time uses.<\/p>\n<p>The function signature looks like this:<\/p>\n<pre class=\"brush:java\">\nimport com.google.cloud.functions.HttpFunction;\nimport com.google.cloud.functions.HttpRequest;\nimport com.google.cloud.functions.HttpResponse;\n\npublic class HelloHttp implements HttpFunction {\n\n    @Override\n    public void service(HttpRequest request, HttpResponse response) throws IOException {\n        final BufferedWriter writer = response.getWriter();\n        response.setContentType(\"application\/html\");\n        writer.write(\"Hello World\");\n    }\n}\n<\/pre>\n<h3 class=\"wp-block-heading\">Testing the Function<\/h3>\n<p>This function can be tested locally using an <a href=\"https:\/\/github.com\/GoogleCloudPlatform\/functions-framework-java\/tree\/master\/invoker\" target=\"_blank\" rel=\"noopener\">Invoker<\/a> that is provided by the functions-framework-api, my code <a href=\"https:\/\/github.com\/bijukunjummen\/http-cloudfunction-java-gradle\">https:\/\/github.com\/bijukunjummen\/http-cloudfunction-java-gradle<\/a> shows how it can be hooked up with gradle, suffice to say that invoker allows an endpoint to brought up and tested with utilities like curl.<\/p>\n<h3 class=\"wp-block-heading\">Deploying the Function<\/h3>\n<p>Now comes the easy part about deploying the function. Since a lot of Google Cloud Services need to be orchestrated to get a function deployed \u2014 GCS, Cloud Build, Cloud Run and Cloud Function, the command line to deploy the function does a great job of indicating which services need to be activated, the command to run looks like this:<\/p>\n<div>\n<pre class=\"brush:java\">gcloud beta functions deploy java-http-function \\\n--gen2 \\\n--runtime java17 \\\n--trigger-http \\\n--entry-point functions.HelloHttp \\\n--source .\/build\/libs\/ \\\n--allow-unauthenticated<\/pre>\n<\/div>\n<p>Note that atleast for Java, it is sufficient to build the code locally and provide the built uber jar(jar with all dependencies packaged in) as the source.<\/p>\n<p>Once deployed, the endpoint can be found using the following command:<\/p>\n<div>\n<pre class=\"brush:java\">gcloud beta functions describe java-http-function --gen2<\/pre>\n<\/div>\n<p>and the resulting endpoint accessed via a curl command!<\/p>\n<div>\n<pre class=\"brush:java\">curl https:\/\/java-http-function-abc-uw.a.run.app\nHello World<\/pre>\n<\/div>\n<h3 class=\"wp-block-heading\">What is Deployed<\/h3>\n<p>This is a bit of an exploration of what gets deployed into a GCP project, let\u2019s start with the Cloud Function itself.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/CloudFunc-Dashboard.png\"><img decoding=\"async\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/CloudFunc-Dashboard-1024x497.png\" alt=\"\" class=\"wp-image-114354\" width=\"768\" height=\"373\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/CloudFunc-Dashboard-1024x497.png 1024w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/CloudFunc-Dashboard-300x146.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/CloudFunc-Dashboard-768x373.png 768w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/CloudFunc-Dashboard-1536x746.png 1536w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/CloudFunc-Dashboard-2048x994.png 2048w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n<\/div>\n<p>See how for a Gen2 function, a \u201cPowered by Cloud Run\u201d shows up which links to the actual cloud run deployment that powers this cloud function, clicking through leads to:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/CloudRun-Fn.png\"><img decoding=\"async\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/CloudRun-Fn-1024x418.png\" alt=\"\" class=\"wp-image-114355\" width=\"768\" height=\"314\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/CloudRun-Fn-1024x418.png 1024w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/CloudRun-Fn-300x122.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/CloudRun-Fn-768x313.png 768w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/CloudRun-Fn-1536x627.png 1536w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/07\/CloudRun-Fn-2048x835.png 2048w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n<\/div>\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n<p>This concludes the steps to deploy a simple Java based Gen2 Cloud Function that responds to http calls. The post shows how the Gen 2 Cloud Function is more or less a pass through to Cloud Run. The sample is available in <a href=\"https:\/\/github.com\/bijukunjummen\/http-cloudfunction-java-gradle\" target=\"_blank\" rel=\"noopener\">my github repository<\/a> \u2014 https:\/\/github.com\/bijukunjummen\/http-cloudfunction-java-gradle<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>Published on Java Code Geeks with permission by Biju Kunjummen, partner at our <a href=\"\/\/www.javacodegeeks.com\/join-us\/jcg\/\" target=\"_blank\" rel=\"noopener\">JCG program<\/a>. See the original article here: <a href=\"http:\/\/www.java-allandsundry.com\/2022\/06\/google-cloud-functions-2nd-gen-java.html\" target=\"_blank\" rel=\"noopener\">Google Cloud Functions (2nd Gen) Java Sample<\/a><\/p>\n<p>Opinions expressed by Java Code Geeks contributors are their own.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Cloud Functions (2nd Gen) is Google\u2019s Serverless Functions as a Service Platform. 2nd Generation is now built on top of the excellent Google Cloud Run as a base. Think of Google Cloud Run as a Serverless environment for running containers which respond to events(http being the most basic, all sorts of other events via eventarc). &hellip;<\/p>\n","protected":false},"author":236,"featured_media":112,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-114296","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Google Cloud Functions (2nd Gen) Java Sample - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn about Google Cloud Functions? Check our article presenting Google Cloud Functions 2nd generation.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2022\/07\/google-cloud-functions-2nd-gen-java-sample.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Google Cloud Functions (2nd Gen) Java Sample - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn about Google Cloud Functions? Check our article presenting Google Cloud Functions 2nd generation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2022\/07\/google-cloud-functions-2nd-gen-java-sample.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-18T04:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Biju Kunjummen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Biju Kunjummen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2022\\\/07\\\/google-cloud-functions-2nd-gen-java-sample.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2022\\\/07\\\/google-cloud-functions-2nd-gen-java-sample.html\"},\"author\":{\"name\":\"Biju Kunjummen\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/802eedfe6f17c3c13fa656af46b6b0e5\"},\"headline\":\"Google Cloud Functions (2nd Gen) Java Sample\",\"datePublished\":\"2022-07-18T04:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2022\\\/07\\\/google-cloud-functions-2nd-gen-java-sample.html\"},\"wordCount\":557,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2022\\\/07\\\/google-cloud-functions-2nd-gen-java-sample.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2022\\\/07\\\/google-cloud-functions-2nd-gen-java-sample.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2022\\\/07\\\/google-cloud-functions-2nd-gen-java-sample.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2022\\\/07\\\/google-cloud-functions-2nd-gen-java-sample.html\",\"name\":\"Google Cloud Functions (2nd Gen) Java Sample - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2022\\\/07\\\/google-cloud-functions-2nd-gen-java-sample.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2022\\\/07\\\/google-cloud-functions-2nd-gen-java-sample.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"datePublished\":\"2022-07-18T04:00:00+00:00\",\"description\":\"Interested to learn about Google Cloud Functions? Check our article presenting Google Cloud Functions 2nd generation.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2022\\\/07\\\/google-cloud-functions-2nd-gen-java-sample.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2022\\\/07\\\/google-cloud-functions-2nd-gen-java-sample.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2022\\\/07\\\/google-cloud-functions-2nd-gen-java-sample.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"java-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2022\\\/07\\\/google-cloud-functions-2nd-gen-java-sample.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Google Cloud Functions (2nd Gen) Java Sample\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/802eedfe6f17c3c13fa656af46b6b0e5\",\"name\":\"Biju Kunjummen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g\",\"caption\":\"Biju Kunjummen\"},\"sameAs\":[\"http:\\\/\\\/biju-allandsundry.blogspot.com\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Biju-Kunjummen\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Google Cloud Functions (2nd Gen) Java Sample - Java Code Geeks","description":"Interested to learn about Google Cloud Functions? Check our article presenting Google Cloud Functions 2nd generation.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2022\/07\/google-cloud-functions-2nd-gen-java-sample.html","og_locale":"en_US","og_type":"article","og_title":"Google Cloud Functions (2nd Gen) Java Sample - Java Code Geeks","og_description":"Interested to learn about Google Cloud Functions? Check our article presenting Google Cloud Functions 2nd generation.","og_url":"https:\/\/www.javacodegeeks.com\/2022\/07\/google-cloud-functions-2nd-gen-java-sample.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2022-07-18T04:00:00+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","type":"image\/jpeg"}],"author":"Biju Kunjummen","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Biju Kunjummen","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2022\/07\/google-cloud-functions-2nd-gen-java-sample.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2022\/07\/google-cloud-functions-2nd-gen-java-sample.html"},"author":{"name":"Biju Kunjummen","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/802eedfe6f17c3c13fa656af46b6b0e5"},"headline":"Google Cloud Functions (2nd Gen) Java Sample","datePublished":"2022-07-18T04:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2022\/07\/google-cloud-functions-2nd-gen-java-sample.html"},"wordCount":557,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2022\/07\/google-cloud-functions-2nd-gen-java-sample.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2022\/07\/google-cloud-functions-2nd-gen-java-sample.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2022\/07\/google-cloud-functions-2nd-gen-java-sample.html","url":"https:\/\/www.javacodegeeks.com\/2022\/07\/google-cloud-functions-2nd-gen-java-sample.html","name":"Google Cloud Functions (2nd Gen) Java Sample - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2022\/07\/google-cloud-functions-2nd-gen-java-sample.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2022\/07\/google-cloud-functions-2nd-gen-java-sample.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","datePublished":"2022-07-18T04:00:00+00:00","description":"Interested to learn about Google Cloud Functions? Check our article presenting Google Cloud Functions 2nd generation.","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2022\/07\/google-cloud-functions-2nd-gen-java-sample.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2022\/07\/google-cloud-functions-2nd-gen-java-sample.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2022\/07\/google-cloud-functions-2nd-gen-java-sample.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","width":150,"height":150,"caption":"java-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2022\/07\/google-cloud-functions-2nd-gen-java-sample.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Google Cloud Functions (2nd Gen) Java Sample"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/802eedfe6f17c3c13fa656af46b6b0e5","name":"Biju Kunjummen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g","caption":"Biju Kunjummen"},"sameAs":["http:\/\/biju-allandsundry.blogspot.com"],"url":"https:\/\/www.javacodegeeks.com\/author\/Biju-Kunjummen"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/114296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/236"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=114296"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/114296\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/112"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=114296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=114296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=114296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}