Add RouterFunction bean id to the RouterFunctions.Visitor [SPR-17579] #22111
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: declined
A suggestion or change that we don't feel we should currently apply
type: enhancement
A general enhancement
Alex Boyko opened SPR-17579 and commented
STS team attempts to find a spot in the source code that declares RM using functional style using the JSON data from the Actuator.
For example for the source code
We'd like to find for
/vets
and/vets.html
routes the method:There are two pieces of data to help find the method: predicate and handler.
The handler data should be the most helpful in matching the method. However, based on the handler data we cannot match the
route()
method unfortunately. The lambda with magic numbers is useless in this case.It'd be great if each router function could hold the id of the RouterFunction bean for example or expose the RouterFunction bean id in the
RouterFunctions.Visitor
such that instead ofwe'd have:
Down the stream Boot Actuator could pick that bean id and pass it down to JMX bean data for the functional RM. Thus we on the STS side could find the method defining bean with the id and then associate that place in the source code to a place where functional RM is defined.
Otherwise, currently actuator has an aggregate RouterFuctions object that has all RMs and extracts predicates and handlers for each RM from the aggregate RouterFuctions object with a help of RouterFunctions.Visitor
Here is the related Boot Actuator issue: spring-projects/spring-boot#15230
Affects: 5.1.3
Reference URL: spring-projects/spring-boot#15230
The text was updated successfully, but these errors were encountered: