Commit Graph

166 Commits

Author SHA1 Message Date
Oliver Drotbohm
9082ca27bb GH-118 - Reworked infrastructure to complete event publications.
Previously we used a dedicated BeanPostProcessor to decorate beans that expose transactional event listeners with an interceptor to mark event publications as completed if the method invocation completes successfully. We now have simplified the arrangement by using Spring's auto-proxy creation and registering an Advisor implementation. This allows us to properly and reliably  order the interceptor between the async one (goes before ours) and the transactional one (goes after ours). Also, this significantly simplifies the implementation of the interceptor as we can assume only commit listener methods being intercepted in the first place.
2023-01-16 21:57:45 +01:00
Oliver Drotbohm
6f5de96dcc GH-117 - Polishing. 2023-01-13 17:42:51 +01:00
Oliver Drotbohm
cacf14748c GH-117 - Test starter now includes the Spring Boot one and Awaitility. 2023-01-13 17:42:43 +01:00
Oliver Drotbohm
6616aaaffa GH-116 - PublishedEvents now sees events from asynchronous event listeners as well.
The ApplicationListener we deploy to capture events published  during a test method execution now uses an InheritableThreadLocal so that events published on threads spawned from the main test execution thread also end up in the PublishedEvents instance prepared for the test method.

Also, the registration of that particular event listener avoids duplicate registrations by inspecting the application context in use for the test method execution for an already registered listener, falling back to registering one.
2023-01-13 16:13:34 +01:00
Oliver Drotbohm
c4321c5305 GH-111 - Link to Javadoc from project metadata in reference documentation. 2023-01-12 20:07:13 +01:00
Oliver Drotbohm
e8cdaa4977 GH-115 - Polish up example.
Upgraded to Spring Boot 3.0.1. Added starters for web and added configuration to expose applicationmodules actuator. Tweak logs to follow Boot's default configuration. Removed obsolete milestone repository.
2023-01-12 18:08:19 +01:00
Oliver Drotbohm
98eeb284b3 GH-110 - Remove obsolete plugin repository declaration.
It was only used to access the Spring Asciidoctor Backends, but starting with version 0.0.4, the JAR is available from Maven Central.
2023-01-12 16:57:59 +01:00
Oliver Drotbohm
54b8ffa566 GH-111 - Optionally depend on Spring Boot autoconfiguration to keep Javadoc happy.
ModulithMetadata refers to SpringBootApplication in its Javadoc, which requires us to have the JAR on the classpath for Javadoc creation as the linting otherwise fails.
2023-01-12 16:50:23 +01:00
Oliver Drotbohm
5c34886907 GH-114 - Rename ….modulith.model to ….modulith.core. 2023-01-12 16:34:07 +01:00
Oliver Drotbohm
0d009f06c9 GH-111 - Package and publish Javadoc.
A lot of Javadoc polish. Not done yet.
2023-01-12 16:20:20 +01:00
Oliver Drotbohm
9a01404ce2 GH-113 - Use colored inline icons in reference documentation. 2023-01-12 01:26:14 +01:00
Oliver Drotbohm
711325b613 GH-112 - Enable actuators in example project. 2023-01-12 01:22:37 +01:00
Oliver Drotbohm
05643bba9c GH-110 - Upgrade to Spring Asciidoctor Backends 0.0.4. 2023-01-12 01:08:19 +01:00
Oliver Drotbohm
9ce6bf23ae GH-14 - Remove Lombok from production sources.
Polished a lot of Javadoc.
2023-01-12 01:05:35 +01:00
Oliver Drotbohm
20554c3af3 GH-103 - Reference documentation for ApplicationModuleInitializer. 2023-01-06 16:23:20 +01:00
Oliver Drotbohm
5f25974f0d GH-107 - Improve runtime support configuration setup.
The configuration classes declaring SpringBootApplicationRuntime and ApplicationModulesRuntime beans now describe them as infrastructure beans so that they do not get reported as eagly initialized as their initialization will be triggered when creating the BeanPostProcessors our observability support is based on.

The configuration of the observability support now consistently refer to ApplicationModulesRuntime directly and to the Tracer instance via a supplier as the latter is only needed during the actual component invocation while the former is already needed to decide whether to decorate the instances in the first place. Simplify the inheritance arrangement underneath ModuleTracingSupport.

The logging adapter for ApplicationModuleInitializers now properly unwraps proxy types so that the log output uses the user classes properly.
2023-01-05 20:00:58 +01:00
Oliver Drotbohm
262efb5828 GH-106 - Avoid intercepting Object and proxy-related methods for module interaction tracing.
We now skip Object methods and ones declared on Spring's Advised or TargetClassAware types when intercepting invocations to trigger a module entry.
2023-01-05 20:00:54 +01:00
Oliver Drotbohm
91c746c63c GH-105 - Prevent Testcontainers-based tests from failing if no Docker is available. 2023-01-05 16:39:26 +01:00
Oliver Drotbohm
ae5475d351 GH-87 - Make sure actuator endpoint outputs modules in topological order.
More fundamental modules are now rendered first as we use a LinkedHashMap as primary data structure.
2023-01-05 16:24:45 +01:00
Oliver Drotbohm
d8463bb84b GH-102 - Avoid topological sorting to fail on cyclic module graphs.
We now fall back to the default non-topological ordering in case the application module graph contains cycles.
2023-01-05 11:21:14 +01:00
Oliver Drotbohm
30203ecca8 GH-104 - Polish log output for test execution.
Also added ApplicationModules.toString().
2023-01-05 10:21:42 +01:00
Oliver Drotbohm
d9aedb8ebf GH-103 - Introduce ApplicationModuleInitializer.
Application modules can now declare instances of ApplicationModuleInititalizer to execute code upon an ApplicationStartedEvent.

This is achieved by registering a corresponding ApplicationListener in SpringModulithRuntimeAutoConfiguration to invoke all instances of AMI sorted via the Comparator introduced in GH-102. To make sure that the invocation order follows topological order, the runtime module strongly depends on JGraphT.
2023-01-05 10:21:42 +01:00
Oliver Drotbohm
a7e033172b GH-102 - ApplicationModules now allows traversing modules in topological order.
We now optionally integrate with the JGraphT library to calculate the topological order of modules based on their dependency structure. That order is then exposed in ApplicationModules' iteration and via ….getComparator().

Renamed FormattableJavaClass to FormattableType and allow it to be created from a plain Class as well.
2023-01-05 10:21:36 +01:00
Oliver Drotbohm
dde02ae257 GH-100 - Update reference documentation. 2023-01-03 13:23:17 +01:00
Oliver Drotbohm
3b1bde5c36 GH-100 - Polishing. 2023-01-03 08:50:27 +01:00
Oliver Drotbohm
5d285e0e03 GH-100 - Introduce AssertablePublishedEvents.
In case AssertJ is on the classpath, test cases using the PublishedEventsExtension (for example, implicitly activated via @ApplicationModuleTest) can get an AssertablePublishedEvents injected into the method. In contrast to the original PublishedEvents, that one acts as AssertProvider so that it can be used in assertThat(…).… expressions to verify application events published.

Polished API in PublishedEvents for a more consistent experience.
2023-01-03 02:44:01 +01:00
Oliver Drotbohm
4e13fbf7f8 GH-99 - Extend license headers to 2023. 2023-01-02 18:12:29 +01:00
Oliver Drotbohm
a343f6eac3 GH-98 - Upgrade checkout and setup-java actions to V3. 2022-12-31 13:14:11 +01:00
Oliver Drotbohm
652a7b8528 GH-97 - Rework calculation of coordinates for WeekHasPassed events.
They now also work correctly when shifting time across a year's end.
2022-12-31 13:07:43 +01:00
Oliver Drotbohm
2d933d07c5 GH-92 - Prepare next development iteration. 2022-12-23 17:32:38 +01:00
Oliver Drotbohm
888055cf7c GH-92 - Release version 0.2.0. 2022-12-23 17:32:37 +01:00
Oliver Drotbohm
86d03864cc GH-92 - Enable deployment for distribution module in documentation profile.
Required due to a change in Artifactory Maven Plugin behavior [0].

[0] https://github.com/jfrog/artifactory-maven-plugin/issues/39
2022-12-23 17:16:34 +01:00
Oliver Drotbohm
e50894c973 GH-91 - General build plugin updates.
AsciidoctorJ 2.5.7.
2022-12-23 16:53:32 +01:00
Oliver Drotbohm
986ee1bb85 GH-90 - Upgrade to Flapdoodle MongoDB 4.3.2 (Boot 3 compatible).
Allows us to get rid of the custom MongoDB infrastructure test configuration.
2022-12-23 16:53:29 +01:00
Oliver Drotbohm
1c6e70b453 GH-89 - Upgrade Artifactory Maven Plugin to 3.5.1. 2022-12-23 16:10:12 +01:00
Oliver Drotbohm
25f789f298 GH-80 - Renamed ApplicationModuleIntegrationListener to ApplicationModuleListener. 2022-12-23 15:43:15 +01:00
Oliver Drotbohm
c1fc3032b7 GH-87 - Expose module structure as actuator endpoint.
Introduce Spring Modulith Actuator module to expose the application module structure as Spring Boot actuator. This required a Spring Modulith Runtime module to be extracted from the Spring Modulith Observability one. The former now contains the auto-configured ApplicationRuntime and ApplicationModulesRuntime bean instances to be able to bootstrap a ApplicationModules asynchronously on application startup. The actuator module then contains a Spring Boot @Endpoint implementation consuming the ApplicationModules to render JSON describing the application module structure.
2022-12-23 10:56:47 +01:00
Oliver Drotbohm
9dff5cc973 GH-88 - Upgrade to Spring Boot 3.0.1. 2022-12-22 22:57:56 +01:00
Oliver Drotbohm
9463b598c3 GH-80 - Introduce ApplicationModuleIntegrationListener.
We now provide @ApplicationModuleIntegrationListener as shortcut for the combination of @Async @Transactional @TransactionalEventListener to provide a dedicated annotation for the recommended integration arrangement.
2022-12-02 18:23:16 +01:00
Oliver Drotbohm
486f7e0c86 GH-81 - Change Postgres event publication schema to follow best practices.
* No uppercase table and column names [0]
* Don't use varchar(n) by default [1]
* Don't use timestamp(…) or timestamptz(…)

[0] https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don't_use_upper_case_table_or_column_names
[1] https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don't_use_varchar(n)_by_default
[2] https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don't_use_timestamp(0)_or_timestamptz(0)
2022-12-02 17:33:04 +01:00
Oliver Drotbohm
ac072805b8 GH-78 - Prepare next development iteration. 2022-11-24 23:30:15 +01:00
Oliver Drotbohm
7f1e22db63 GH-78 - Release version 0.1.0. 2022-11-24 23:30:15 +01:00
Oliver Drotbohm
dc2f07b02e GH-77 - Add project description. 2022-11-24 23:28:51 +01:00
Oliver Drotbohm
5542cd172d GH-77 - Avoid release event support integration tests to Maven Central. 2022-11-24 23:18:52 +01:00
Oliver Drotbohm
8121516abc GH-77 - Complete project metadata for Maven Central release. 2022-11-24 23:07:17 +01:00
Oliver Drotbohm
073c954070 GH-77 - Enable CI profile for release build.
To make sure we create Javadoc JARs.
2022-11-24 23:06:11 +01:00
Oliver Drotbohm
7d721c2a6b GH-62 - Upgrade example to jMolecules 2022.2.2. 2022-11-24 22:54:18 +01:00
Oliver Drotbohm
9bab51cd35 GH-77 - Upgrade example to Boot 3.0. 2022-11-24 22:54:05 +01:00
Daniel Bär
ec613d52c5 GH-75 - Fix typo in reference documentation. 2022-11-24 22:43:54 +01:00
Oliver Drotbohm
02881539b6 GH-77 - Avoid exposing TestUtils to user applications.
Moved TestUtils from spring-modulith-test to spring-modulith-integration-test as it's only used there and doesn't need to be exposed to user applications.
2022-11-24 22:35:32 +01:00