Hi,

Currently at work I have created a simple endpoint for exposing Diagnostic MBean from actuator, so I decided to contribute to it with this change.

Functionality: - Expose operations from Diagnostic MBean. - Get details for one specific operation. - Execute an operation with or without parameters. - Also this endpoint allows to get some resources (This is because some operations like JFR, generate a file for the result, anyway there is a mechanism to filter which kind of resources can be fetched).

Screenshots

Get Operations springboot Add support for Diagnostic MBean in actuator

Get Operation Details springboot Add support for Diagnostic MBean in actuator

Execute Operation springboot Add support for Diagnostic MBean in actuator

If you consider this can be useful but it requires more changes I can work on that but if you consider this is not a valid use case for actuator endpoints just close the pull request.

Comment From: philwebb

Thanks very much for the pull-request @ldebello. We plan to discuss this a little more as team when we meet at Spring One in a few weeks. Unfortunately we probably won't be able to merge this in time for 2.2, but we'll review it and consider the options for 2.3.

Comment From: ldebello

@philwebb thanks for the update, let me know if I can help in something

Comment From: ldebello

Hi,

I would like to know if there is something from my side that I can do to help with this

Comment From: wilkinsona

@ldebello Thanks for the offer, but we don't need anything from you at the moment. As @philwebb indicated above, we'll review and consider this for 2.3 in due course.

Comment From: ldebello

Awesome, thanks :)

Comment From: ldebello

Hi team. Do I need to update my branch to allow you to review this or you can review and if this is ok do the update branch later?

Comment From: wilkinsona

Hi, @ldebello. Thanks again for the offer. We don't need anything from you at the moment.

The core team have discussed this a bit. We're currently leaning towards not merging the changes but we haven't reached a final decision. The general problem of exposing MBeans over HTTP is something that we'd prefer to be solved by Jolokia for which Spring Boot already has auto-configuration. For those that want access specifically to the diagnostics MBean but do not want to use Jolokia, our current feeling is that support would be better maintained as a third-party starter rather than in Spring Boot itself.

I'll flag this for team attention so that we can discuss this again sometime soon and hopefully reach a final decision.

Comment From: ldebello

Awesome, thanks for the reply. Before sending the PR I thought the same about using jolokia, but I thought it could be more useful to expose this in a different way for diagnostics tools. I also thought about exposing it as starter project but I believed as contribution could be more valuable but I can create a starter for this :). If the team arrives to a conclusion please let me know and I can close the PR and create the starter-project.

Comment From: wilkinsona

We discussed this one today and I'm afraid that we concluded that we don't want to merge and support it ourselves. Thanks again for your PR and for your understanding of our decision. If you do create a third-party starter with this functionality, we'd be happy to add it to the list of community starters.