Add customizers for the module canvas feature #1099
Replies: 2 comments 7 replies
-
It seems that private List<EventType> findPublishedEvents() {
DescribedPredicate<JavaClass> isEvent = implement(JMoleculesTypes.DOMAIN_EVENT)
.or(isAnnotatedWith(JMoleculesTypes.AT_DOMAIN_EVENT));
return classes.that(isEvent).stream()
.map(EventType::new).toList();
} In our case, we use a custom framework, so it would be good to able to override this predicate. As a workaround, we could add the JMolecules annotation to each published event and create an ArchUnit test to ensure all published events have this annotation. However, a much simpler solution would be to override the predicate. |
Beta Was this translation helpful? Give feedback.
-
@odrotbohm hi. I'm continuing to implement modulith into my services and I have a new idea. Currently, the structure of the aggregated documentation (all-docs.adoc) is hardcoded, which prevents me from adding additional information to my modules. It would be nice to define a template for module documentation to make it extensible. For example, include a service resources file like
This way, I can modify the template and add my custom adoc files to the aggregated documentation. |
Beta Was this translation helpful? Give feedback.
-
Hello. The Spring Modulith Documentation module offers a great feature that allows us to create documentation with essential insights about application modules:
Documenter(applicationModules) .writeModuleCanvases()
However, there is no option to customize (add or remove) information from this documentation. In our case, we do not use Spring annotations like
@Repository
or@Controller
. Instead, we use the@Component
annotation for all beans. Additionally, we do not use the default Spring events system - we use our proprietary pub/sub framework, so "Published events" and "Events listened to" are not applicable to us.It would be good to have the ability to override the default
toModuleCanvas
template located inDocumenter#toModuleCanvas
, allowing us to customize it and include only the categories we are interested in.To provide more context, we use Kafka and Nats (nats.io) for external communication and our internal framework for pub/sub communication between modules. I would like to generate documentation with the following sections: "Kafka listeners," "Nats listeners," and "Internal listeners." So to implement what we want to have, we need the ability to 1) filter application module classes that implement specific interfaces, 2) override default canvas template to add custom categories.
Please let me know if this approach is acceptable so I can propose my implementation vision.
Beta Was this translation helpful? Give feedback.
All reactions