liveBook · Manning

Funqy

As explained in Quarkus in Action

Funqy is a Quarkus programming model and library for defining portable functions that can run across multiple function-as-a-service platforms.

Funqy is Quarkus’s simplified programming model for portable serverless functions. It provides one API across platforms such as Knative, AWS Lambda, Google Cloud Functions, and Azure Functions, avoiding provider-specific Java APIs and integrations. section 11.5.2 section 11.8

A function is defined with the @Funq annotation. Funqy can accept and return POJOs with default constructors and getters and setters, use reactive Mutiny types, and use dependency injection. Its HTTP exposure resembles REST, but it does not replace the full REST feature set. section 11.5.2

A minimal Funqy function

import io.quarkus.funqy.Funq; public class Function { @Funq public String process(String input) { return "Processed: " + input; } } section 11.5.2

A practical application can combine Funqy with other Quarkus extensions. The car-statistics service uses the Funqy HTTP extension, a SmallRye GraphQL client, and OpenShift integration, then deploys as a Knative service. section 11.5.3

The deployment configuration controls the generated serverless resources:

  • Set quarkus.kubernetes.deployment-target=knative to generate Knative resources. section 11.5.3
  • Configure the image registry, namespace, and image source used by Knative. section 11.5.3
  • Limit concurrent requests per pod with quarkus.knative.revision-auto-scaling.container-concurrency. section 11.5.3
Listing 11.18 The example use of the Funqy API
import io.quarkus.funqy.Funq;

public class Function {
    @Funq
    public String process(String input) {
        return "Processed: " + input;
    }
}

Use the minimal listing to see how @Funq turns an ordinary Java method into a portable function. section 11.5.2

How Quarkus in Action covers it

How deep it goes
Explains annotation-based functions, supported data types, reactive returns, injection, HTTP exposure, and Knative configuration.
Examples
Demonstrates a string-processing function and a car-statistics service that queries Inventory through GraphQL.
What it assumes
Assumes Java and Quarkus application development while introducing FaaS portability, @Funq, and serverless deployment configuration.
What you can do after
Build portable serverless functions and configure their Knative deployment through Quarkus extensions and properties.
How it connects
Connects serverless computing with REST, dependency injection, Mutiny, GraphQL, Kubernetes, OpenShift, and Knative.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quarkus in Action. The section links point to the parts of the book it draws on.