-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Description
Edit: This is based on testing against 2.0.0.M6.
Names of Actuator endpoint @Selector
parameters are set based on their associated method parameter names. For this to work properly, endpoint classes must be compiled with these parameter names embedded (-parameters
javac param, <parameters>true</parameters>
in Maven, etc.). This happens by default if one's Spring Boot Maven project is defined with spring-boot-starter-parent
as its parent. But, if one isn't using this Maven configuration, @Selector
params end-up with names like arg0
, and the cause is non-obvious.
Please consider:
-
Noting in the documentation for custom Actuator endpoints that embedded parameter names are required for custom naming.
-
Adding a
name
parameter to@Selector
that allows one to explicitly specify/override the parameter name.
Note that I haven't looked into whether a default Gradle, etc. Spring Boot set-up results in compilation with embedded parameter names.
Also, even if one has his POM configured to compile with embedded parameter names, separate IDE configuration likely is required to turn this on when allowing an IDE to compile instead:
https://stackoverflow.com/questions/39217830/how-to-use-parameters-javac-option-in-intellij