question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider deprecating @ControllerEndpoint and @RestControllerEndpoint

See original GitHub issue

We should decide if we want to deprecate and later remove @ControllerEndpoint and @RestControllerEndpoint from the actuator. Using them ties the user to WebMVC or WebFlux and they were meant to ease the upgrade path to the weblayer-abstracting @Endpoint with @ReadOperation, etc.

Getting rid of those would pave the way for https://github.com/spring-projects/spring-boot/issues/20290.

If you’re seeing this ticket and object to this idea, please comment, your feedback is very valuable. Please also explain your use case and why this use case can’t be solved with @Endpoint or @WebEndpoint.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mmoayyedcommented, Jul 21, 2022

We have quite a few @RestControllerEndpoint annotations used here.

Main use cases that I think would be useful and helpful to support going forward would be:

  • Support the convenience of @GetMapping, @PostMapping, @ResponseBody, etc.

I think most of these could likely be converted and written to conform to the new way of doing this.

  • Ability to read the servlet request body in raw form without mapping the request body it to an object, using HttpServletRequest#getInputStream()

It might be doable to do this today, but I wasn’t able to find an alternative.

0reactions
mmoayyedcommented, Aug 3, 2022

One other thing that might be useful here: @RestControllerEndpoint allows for overloading methods that address different requirements. For example, one could have multiple @GetMapping methods that handle different concerns, with different parameters or path variables. This seems more natural vs one @ReadOperation with 2-3 parameters some marked as selectors and some marked as not. Perhaps the replacement could provide the same programming model.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RestControllerEndpoint (Spring Boot 3.0.0 API)
Identifies a type as being a REST endpoint that is only exposed over Spring MVC or Spring WebFlux. Mapped methods must be annotated...
Read more >
spring-projects/spring-boot - Gitter
@wilkinsona My application is written in Kotlin and I have @WriteOperation in a custom actuators that takes in a DTO but spring boot...
Read more >
Brian Clozel @bclozel@mamot.fr - Twitter
We should decide if we want to deprecate and later remove @ControllerEndpoint and @RestControllerEndpoint from the actuator. Using them ties the user to...
Read more >
Spring Boot Rest Controller endpoint exception - java
The issue is because of producer media-type. The response only accept image/png , yet when there is an error media-type is application/json ...
Read more >
Deprecating API Endpoints - Stoplight Blog
Deprecation communicates a function, method, or entire package is going ... We're considering building a notification system so teams can ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found