简体   繁体   中英

Jakarta EE 10 @Startup on K8S

Stack Java Jakarta EE 10 JBoss/Widlfly 27 Kube.netes K8S JAX-RS (RestEasy)

I want to initialize some caches on startup of my app. During that time i want my readiness probe to respond not ready.

With the management inteface turned on, this works BUT not with my classes, instead the standard one responds.

Wildfly runs in standalone mode.

What i try to accomplish is to run my OWN code for readiness/live BUT that these endpoints are available during startup. I created my own outside of microprofile.healt but they are not available during startup.

Does anybody have some ideas?

Below is my code

import jakarta.enterprise.context.ApplicationScoped;
import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;
import org.eclipse.microprofile.health.Liveness;
import org.eclipse.microprofile.health.Readiness;

/**
 * Created by Gerry Askefalk  on: 2023-01-13
 */
@ApplicationScoped
@Liveness
@Readiness
public class Mycheck implements HealthCheck {

        @Override
        public HealthCheckResponse call() {
            return HealthCheckResponse.named("mycheck").up().build();
        }
}
 

Ok

the solution (and my bad) was to not add microprofile extensions to WF.

When i did, it works!

This article explained it to me.

microprofile on wf

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM