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
