This folder contains a few sample projects that show the fundamental setup of Spring Modulith as well as a couple of advanced features.
They all use the same domain to showcase the provided integration support.
An order application module that completes an Order
instance as well as an inventory that reacts to the completion of the Order
.
To run the examples, execute the Maven build via ./mvnw
.
-
spring-modulith-example-full
— shows the fundamental module setup, its verification (ModularityTests.verifiesModularStructure()
) and the documentation derived from the arrangement (ModularityTests.createModuleDocumentation()
). It also shows the Event Publication Registry working and how it keeps track of the incomplete event publication caused by theFailingAsyncTransactionalEventListener
. Finally, it shows how to write integration tests using theScenario
APIs inOrderIntegrationTests
. -
spring-modulith-example-epr-jdbc
— shows the Event Publication Registry working on top of Spring Data JDBC (inApplicationIntegrationTests
). -
spring-modulith-example-epr-mongodb
— shows the Event Publication Registry working on top of MongoDB (inApplicationIntegrationTests
).