Igu
Igu

Reputation: 35

Warmup endpoint not working on App Engine

I have a kotlin application on App Engine and I'm trying to set up the warmup endpoint with the code bellow:

@RestController
@RequestMapping("/")
class HealthCheck {
    
    @GetMapping
    fun check(): String {
        return "Hey ho, lets go!"
    }
    
    @GetMapping("/_ah/warmup")
    fun warmup() : String {
        return "Warmed up"
    }
}

Here is the proof that this endpoint works on localhost:

endpoint works on localhost

However, when I run ./gradlew clean build and deploy the jar file to App Engine the endpoint doesn't work

enter image description here

Here is my app.yaml file:

runtime: java11
instance_class: F1
entrypoint: java -noverify -jar leaf-bff-0.0.1-SNAPSHOT.jar
threadsafe: true

automatic_scaling:
  min_instances: 2
  max_instances: 4
  min_idle_instances: 2
  max_concurrent_requests: 25
  target_throughput_utilization: 0.8

inbound_services:
  - warmup

I'm targeting the jvm11.

Upvotes: 0

Views: 267

Answers (1)

Soni Sol
Soni Sol

Reputation: 2612

Try by using only @GetMapping() to each method

I got it to work like this:

@RestController
class HealthCheck {
    
    @GetMapping("/")
    fun check(): String {
        return "Hey ho, lets go!"
    }
    
    @GetMapping("/_ah/warmup")
    fun warmup() : String {
        return "Warmed up"
    }
}

Upvotes: 1

Related Questions