-
Notifications
You must be signed in to change notification settings - Fork 206
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
Evaluate Spring Modulith actuators #953
Comments
Thanks @odrotbohm for filling this enhancement request, would be awesome to support the spring-modulith module structure and the new architecture in the various visualizations for Spring elements that we have in the IDEs. And I think it would be great to not only have this being used in the STS UI, but also VSCode. Using the actuator information here - as you describes - focuses this on the live information that the IDE grabs from a running Spring application. What do you think about having information at hand without running the app as well? (just as an additional thought) |
You're right. The arrangement isn't likely to change much at runtime, and we could also create this JSON structure statically. IIRC we discussed something like this at some point, and you suggested a simple class with a |
The fix for spring-projects/spring-modulith#119 contains a class |
@odrotbohm we marked it for the next release only as a marker rather than deadline. Something we'll start looking at in the next 2 weeks. |
That's great news, thanks! Let me know if I can be of any help. |
I have glanced through the Modulith docs. I think we can show something in the live hints for this... Which module a bean is coming from for example... |
We could also implement a command showing the module dependency tree if we want... Show some s3 tree for example... but I'd try to show it even for the code that is not running. |
@odrotbohm Just noticed that there is java app generating the json... perhaps i could start trying that for now. I'm very curious to know about what you think about the same approach as for boot properties metadata JSON... |
Thanks for your feedback, Alex. @martinlippert and I had agreed on the main method approach for a start, as the module structure metadata creation takes a few milliseconds (as it needs to analyze the application's class files and potentially ones from JARs). Thus, a manual trigger to update the information seemed reasonable, also, as the structure is unlikely to change regularly. For the dependencies check, I wonder if we can somehow rather leverage the Java APIs already in place on Happy to jump on a Zoom to discuss. |
@odrotbohm I'm a bit confused how to build the Wonder if for class B imported into class A the following would work:
|
Can you elaborate what you're trying to achieve? I'm not certain that I follow on the class A / B thing, either. It doesn't really make sense for a type in one module to be exposed by another, as – by definition – a type can only live in one module. If it's about implementing the dependency checks described above, the algorithm could be as follows:
then:
Does this make sense? If you'd like to void working with HTH |
Yes, it helps, thanks very much |
Spring Modulith exposes actuators that describe the logical application modules defined in a Spring Boot application. Those modules declare a base package within which all its components reside.
It would be nice if the actuator integration in STS made use of that information to augment the views it provides in supported IDEs to group the listed information by application module. Here are some ideas:
The JSON structure exposed by the actuator is described in the corresponding section of the reference documentation. An example application is available in Spring Modulith's repository. It's
spring-modulith-example
that can be imported in any IDE, started with./mvnw spring-boot:run
and exposes two modulesorder
andinventory
at http://localhost:8080/actuator/applicationmodules.Please let me know if there's anything else you'd like to know, or I could help with.
The text was updated successfully, but these errors were encountered: