Google has announced support for Java 11 on its serverless computing platform Cloud Functions.
As a serverless platform, Cloud Functions run snippets of code without a developer needing to manage servers. Cloud Functions for Java 11 allows developers to write code in JVM languages like Java, Kotlin, Groovy, and Scala through the Functions Framework for Java, which is a functions-as-a-service framework for writing Java functions.
RELATED CONTENT: Java celebrates 25th anniversary following the release of Java 14
There are two types of functions in serverless computing: HTTP and background functions. HTTP functions are used to respond to HTTP events; Background functions are used to process events sourced from cloud and GCP services. The Functions Framework for Java provides an API that can be used to author those functions. It also provides an invoker for calling and running those functions, either locally or in any Java 11 environment, Google explained.
In addition to the Functions Framework for Java, Google is now offering out-of-the-box support for the Micronaut framework and Spring Cloud Function project. Developers can choose what framework they want to use and create HTTP and background functions using that framework’s model.
According to Google, some example use cases for functions are real-time data processing, handling real-time event streams, and intelligent applications like chat bots or video, image, and sentiment analysis.
“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,” Guillaume Laforge, developer advocate for Google Cloud, wrote in a post.
Cloud Functions for Java 11 is currently in beta. Developers can try it out with their favorite JVM language and frameworks.