Skip to content

Allow to set loadOnStartup on actuator EndpointServlet's #15672

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
juliojgd opened this issue Jan 10, 2019 · 5 comments
Closed

Allow to set loadOnStartup on actuator EndpointServlet's #15672

juliojgd opened this issue Jan 10, 2019 · 5 comments
Labels
status: superseded An issue that has been superseded by another type: enhancement A general enhancement

Comments

@juliojgd
Copy link
Contributor

EndpointServlet endpointServlet = endpoint.getEndpointServlet();
Dynamic registration = servletContext.addServlet(name,
endpointServlet.getServlet());
registration.addMapping(urlMapping);
registration.setInitParameters(endpointServlet.getInitParameters());
logger.info("Registered '" + path + "' to " + name);

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.

@wilkinsona wilkinsona added the status: waiting-for-triage An issue we've not yet triaged label Jan 10, 2019
@wilkinsona
Copy link
Member

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

@wilkinsona wilkinsona added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 26, 2019
@rhamedy
Copy link
Contributor

rhamedy commented Feb 26, 2019

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

@wilkinsona
Copy link
Member

wilkinsona commented Feb 26, 2019

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.

@juliojgd
Copy link
Contributor Author

Still interested. Working on it.

juliojgd pushed a commit to juliojgd/spring-boot that referenced this issue Feb 27, 2019
loadOnStartup property was missing from EndpointServlet and cannot
be set inside ServletEndpointRegistrar. Now it can be set and register
a Servlet with that integer property ready to act upon registration

Fixes spring-projects#15672
@wilkinsona
Copy link
Member

Closing in favour of #16053.

@wilkinsona wilkinsona added the status: superseded An issue that has been superseded by another label Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants