Azure / azure-functions-java-library

Contains annotations for writing Azure Functions in Java
MIT License
43 stars 43 forks source link

Warmup binding on spring cloud based application #176

Closed rcastellor1 closed 2 years ago

rcastellor1 commented 2 years ago

We are working in a spring cloud function based solution, We want to warmup the spring context with a warmupTrigger, is this posible?

The warmup trigger is documented here but I cant find any info about how to integrate it with spring cloud functions:

https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/azure-functions/functions-bindings-warmup.md

kaibocai commented 2 years ago

Th recent PR https://github.com/Azure/azure-functions-java-library/pull/183 adds warmup trigger. Given an example below

@FunctionName("Warmup")
public void warmup(@CustomBinding(direction = "in", name = "warmupContext", type = "warmupTrigger")Object warmupContext, ExecutionContext context) {
    context.getLogger().info("Function App instance is warm up");
}