Files
spring-modulith/spring-modulith-examples
Oliver Drotbohm 9b0062f354 GH-248 - Support to automatically externalize events.
We now allow externalizing application events to a variety of message brokers through the addition of Spring Modulith modules for Kafka, AMQP and JMS to a user project's classpath. Which events shall be externalized and how they're supposed to be routed to the message broker can be configured through either annotations or via a configuration API declared as Spring bean.

In case Jackson is on the classpath, we also add auto-configuration to use a Boot-configured ObjectMapper instance with the corresponding message broker client APIs to properly serialize and deserialize messages to JSON.
2023-09-07 16:29:10 +02:00
..

= Spring Modulith Examples

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 the `FailingAsyncTransactionalEventListener`.
Finally, it shows how to write integration tests using the `Scenario` APIs in `OrderIntegrationTests`.
* `spring-modulith-example-epr-jdbc` -- shows the Event Publication Registry working on top of Spring Data JDBC (in `ApplicationIntegrationTests`).
* `spring-modulith-example-epr-mongodb` -- shows the Event Publication Registry working on top of MongoDB (in `ApplicationIntegrationTests`).