Spring boot 是否有方法将请求参数传递给/health端点?

Spring boot 是否有方法将请求参数传递给/health端点?,spring-boot,spring-boot-actuator,Spring Boot,Spring Boot Actuator,我正在编写一个custome Health指示器来检查与另一个应用程序的连接。然而,为了检查这一点,我需要在/health端点的请求URL中包含一些请求参数(例如,我想要的URL是“/health?countryCode=in”) 有没有办法做到这一点? 谢谢。只需将请求注入,如下所示: public class CustomHealthIndicator{ @Autowired HttpServletRequest request; .... } 仅提及打字错误,它是org.springf

我正在编写一个custome Health指示器来检查与另一个应用程序的连接。然而,为了检查这一点,我需要在/health端点的请求URL中包含一些请求参数(例如,我想要的URL是“/health?countryCode=in”) 有没有办法做到这一点?
谢谢。

只需将请求注入,如下所示:

public class CustomHealthIndicator{

@Autowired
HttpServletRequest request;
....
}

仅提及打字错误,它是org.springframework.beans.factory.annotation.Autowired