Deprecate framework-specific @*Endpoint annotations
Prior to this commit, applications could declare Actuator Endpoints using web framework-specific annotations, such as `@ServletEndpoint`, @ControllerEndpoint and @RestControllerEndpoint. Such annotations are closely tied to the programming model of specific web technologies, such as Servlet or Spring MVC. Unlike other `@Endpoint` support, they are not portable and will not work transparently over blocking/reactive and transports. Because of the strong adherence of this support with the underlying infrastructure, it makes it impossible to evolve the implementation of Actuator support without breaking this use case. The reference documentation has been advocating for using `@Endpoint` and `@*Operation` for custom endpoints for a long time now. This commit deprecates this specific support in favor of the recommended approach. Closes gh-31768
This commit is contained in:
@@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@Component
|
||||
@RestControllerEndpoint(id = "example")
|
||||
@SuppressWarnings("removal")
|
||||
public class ExampleRestControllerEndpoint {
|
||||
|
||||
@GetMapping("/echo")
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
@SpringBootApplication
|
||||
@SuppressWarnings("removal")
|
||||
public class SampleActuatorCustomSecurityApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
*/
|
||||
@Component
|
||||
@RestControllerEndpoint(id = "exception")
|
||||
@SuppressWarnings("removal")
|
||||
public class SampleRestControllerEndpointWithException {
|
||||
|
||||
@GetMapping("/")
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
@SpringBootApplication
|
||||
@SuppressWarnings("removal")
|
||||
public class SampleSecureJerseyApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
@@ -43,6 +44,7 @@ public class SampleSecureJerseyApplication {
|
||||
}
|
||||
|
||||
@ServletEndpoint(id = "se1")
|
||||
@SuppressWarnings("removal")
|
||||
static class TestServletEndpoint implements Supplier<EndpointServlet> {
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user