Spring-boot: Allow to set loadOnStartup on actuator EndpointServlet's

Created on 10 Jan 2019  路  5Comments  路  Source: spring-projects/spring-boot

https://github.com/spring-projects/spring-boot/blob/badccc083e1e3b24aee684fb306845f48c1f7147/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java#L73-L78

Why is setting loadOnStartup not allowed in ServletEndpointRegistrar?
In my specific use case I need that the invocation of 'init' method in wrapped Servlet instance be on startup, not in the first http invocation.
Is there a reason to not provide this option for EndPointServlet's?

To provide it, org.springframework.boot.actuate.endpoint.web.EndpointServlet should contain a property 'loadOnStartup' in addition to already present 'initParameters' property. If there is no reason to not do it, I can provide a PR.

Thanks for answering.

superseded enhancement

Most helpful comment

Thank you for the offer. I'd like to give @juliojgd a little while to prepare something if they're still interested in doing so. Let's give them a week or so and see where we are.

All 5 comments

I think an attribute for configuring loadOnStartup makes sense and a PR would be most welcome. Thanks.

@wilkinsona if not already taken can I work on this issue?

Thank you for the offer. I'd like to give @juliojgd a little while to prepare something if they're still interested in doing so. Let's give them a week or so and see where we are.

Still interested. Working on it.

Closing in favour of #16053.

Was this page helpful?
0 / 5 - 0 ratings