❯ Guillaume Laforge

Java

Introducing Java 11 on Google Cloud Functions

The Java programming language recently turned 25 years old, and it’s still one of the top-used languages powering today’s enterprise application customers. On Google Cloud, you can already run serverless Java microservices in App Engine and Cloud Run. Today we’re bringing Java 11 to Google Cloud Functions, an event-driven serverless compute platform that lets you run locally or in the cloud without having to provision servers. That means you can now write Cloud Functions using your favorite JVM languages (JavaKotlinGroovyScala, etc) with our Functions Framework for Java, and also with Spring Cloud Functions and Micronaut!

Read more...

Sip a Cup of Java 11 for Your Cloud Functions

With the beta of the new Java 11 runtime for Google Cloud Functions, Java developers can now write their functions using the Java programming language (a language often used in enterprises) in addition to Node.js, Go, or Python. Cloud Functions allow you to run bits of code locally or in the cloud, without provisioning or managing servers: Deploy your code, and let the platform handle scaling up and down for you. Just focus on your code: handle incoming HTTP requests or respond to some cloud events, like messages coming from Cloud Pub/Sub or new files uploaded in Cloud Storage buckets.

Read more...

Deploying serverless functions in Groovy on the new Java 11 runtime for Google Cloud Functions

Java celebrates its 25th anniversary!  Earlier this year, the Apache Groovy team released the big  3.0 version of the programming language.  GMavenPlus was published in version 1.9 (the Maven plugin for compiling Groovy code) which works with Java 14. And today, Google Cloud opens up the beta of the  Java 11 runtime for Cloud Functions. What about combining them all?

I’ve been working for a bit on the Java 11 runtime for Google Cloud Functions (that’s the Function-as-a-Service platform of Google Cloud, pay-as-you-go, hassle-free / transparent scaling), and in this article, I’d like to highlight that you can also write and deploy functions with alternative JVM languages  like Apache Groovy.

Read more...

Start the fun with Java 14 and Micronaut inside serverless containers on Cloud Run

Hot on the heels of the announcement of the general availability of JDK 14, I couldn’t resist taking it for a spin. Without messing up my environment — I’ll confess I’m running 11 on my machine, but I’m still not even using everything that came past Java 8! — I decided to test this new edition within the comfy setting of a Docker container.

Minimal OpenJDK 14 image running JShell

Super easy to get started (assuming you have Docker installed on your machine), create a Dockerfile with the following content:

Read more...

Serverless tip #2 — Deploy an executable JVM application with gcloud without app.yaml or build tool plugin

Requirements:

  • an existing Google Cloud Platform account and project
  • a Java or alternative language web application
  • a build that creates a standalone executable JAR file

Usually App Engine applications in Java are deployed with the gcloud command-line interface, or via a Maven or Gradle build plugin. Either way, an app.yaml file to describe your application is required to let the cloud SDK know that the project at hand is an App Engine project.

Read more...

Serverless tip #1 — Deploy a standalone JVM web app with Gradle and the App Engine plugin

Requirements:

  • an existing Google Cloud Platform account and project
  • a Java or alternative language web application
  • a Gradle build that creates a standalone executable JAR file

In youd build.gradle file, add the App Engine gradle plugin to your buildscript dependencies:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.google.cloud.tools:appengine-gradle-plugin:2.+'
    }
}

Apply the plugin, to make use of it:

apply plugin: "com.google.cloud.tools.appengine-appyaml"

Then you can configure the appengine task to point at the standalone executable JAR:

Read more...

Getting started with Micronaut on Google App Engine Java 11

A new Java runtime was announced for Google App Engine standard: with Java 11. It’s currently in beta, but anybody can already try it out. Another interesting announcement was the fact that the instances running your apps now get double the memory! So with this double dose of great news, I decided to craft a little tutorial to show how to deploy a Micronaut application on App Engine Java 11. And because Apache Groovy is, well, groovy, I’ll go ahead and use Groovy for my programming language, but of course, the same steps apply to Java workloads as well.

Read more...

Turn it up to eleven: Java 11 runtime comes to App Engine

Yesterday, we announced new second-generation runtimes for Go 1.12 and PHP 7.3. In addition, App Engine standard instances now run with double the memory. Today, we’re happy to announce the availability of the new Java 11 second-generation runtime for App Engine standard in beta. Now, you can take advantage of the latest Long-Term-Support version of the Java programming language to develop and deploy your applications on our fully-managed serverless application platform.

Based on technology from the gVisor container sandbox, second-generation runtimes let you write portable web apps and microservices that take advantage of App Engine’s unique auto-scaling, built-in security and pay-per-use billing model—without some of App Engine’s earlier runtime restrictions. Second generation-runtimes also let you build applications more idiomatically. You’re free to use whichever framework or library you need for your project—there are no limitations in terms of what classes you can use, for instance. You can even use native dependencies if needed. Beyond Java, you can also use alternative JVM (Java Virtual Machine) languages like Apache GroovyKotlin or Scala if you wish.

Read more...

A serverless Java developer's journey

Last week at the Google Cloud Next conference, I had the chance to speak about the Java developer’s journey through the “serverless” offering of Google Cloud Platform, with my colleague Vinod Ramachandran (Product Manager on some of our serverless products):

Serverless Java in 2019 is going to be ubiquitous in your favorite cloud. Well, it’s actually been 10 years since you could take advantage of Java on Google App Engine. But now you can run your apps on the brand-new Java 11 runtime. Not only servlet-based apps but also executable JARs. And what about authoring functions? Until now, you could only use Node or Python, but today, Java is the third runtime available for Google Cloud Functions. We will review the various ways you can develop your Java functions. Last but not least, thanks to serverless containers, containerized Java workloads run serverlessly, without you caring for infrastructure, scaling, or paying for idle machines. Through various demos, we will look at the many ways Java developers will be able to write, build, test, and deploy code in Java on the rich serverless offering of Google Cloud Platform.

Read more...

Deploy a Micronaut application containerized with JIB to Google Kubernetes Engine

A few weeks ago, I had the chance to be at Devoxx Belgium once again, to meet developers and learn about new things from awesome speakers. Google Cloud Platform had its own booth on the exhibition floor, and the team was running codelabs: 10 laptops were at the disposal of attendees to go through various hands-on tutorials on several GCP products. I took a chance at crafting my own codelab: deploying a Micronaut application, containerized with Jib, to Google Kubernetes Engine.

Read more...