Appendix
Appendix A: Spring Modulith Configuration Properties
Property | Default value | Description |
---|---|---|
|
|
Whether to configure defaults for the async processing termination, namely to wait for task completion for 2 seconds. See |
|
none |
The strategy to be applied to detect application modules.
Can either be the class name of a custom implementation of |
|
|
How to mark an event publication as completed. The following values are supported:
|
|
|
Whether to enable event externalization. |
|
|
Whether to initialize the JDBC event publication schema. |
|
The schema name for the event publication table. If not specified, the table will not be schema-qualified. |
|
|
|
Whether to enable JSON support for |
|
|
Whether to automatically enable transactions for MongoDB. Requires the database to be run with a replica set. |
|
|
Whether to create indexes on the . |
|
|
Whether to enable JSON support for |
|
|
Whether to republish outstanding event publications on restarts of the application. Usually not recommended in multi-instance deployments as other instances might still be processing events. |
|
|
Whether to enable the |
|
|
The granularity of events to publish. ( |
|
|
The |
|
|
The timezone of the dates for the events being published. |
|
|
Deprecated as of 1.3. Prefer |
|
none |
This can either be one of the predefined values |
|
none |
The commit hash of to which to calculate the set of changed files. Usually propagated in CI environments to consider all changes since the last successful build. |
Appendix B: Spring Modulith modules
Starter | Typical scope | Includes |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Module | Typical scope | Description |
---|---|---|
|
|
A Spring Boot actuator to expose the application module structure via an actuator. |
|
|
The abstractions to be used in your production code to customize Spring Modulith’s default behavior. |
|
|
An annotation processor to extract Javadoc for inclusion in Application Module Canvases. |
|
|
The core application module model and API. |
|
|
The |
|
|
Event externalization support for AMQP. |
|
|
API to customize the event features of Spring Modulith. |
|
|
The core implementation of the event publication registry as well as the integration abstractions |
|
|
A Jackson-based implementation of the |
|
|
A JDBC-based implementation of the |
|
|
Event externalization support for JMS. |
|
|
A JPA-based implementation of the |
|
|
Event externalization support for Kafka. |
|
|
Event externalization support into Spring Messaging |
|
|
A MongoDB-based implementation of the |
|
|
A Neo4j-based implementation of the |
|
|
Test execution optimizations based on the application module structure. Find more details here. |
|
|
The Passage of Time events implementation described here. |
|
|
Observability infrastructure described here. |
|
|
Support to bootstrap an |
|
|
Integration testing support. Find more details here. |
Appendix C: Deprecated modules
Module | Deprecated since | Description |
---|---|---|
|
|
Please migrate to |
|
|
Please migrate to |
Appendix D: Event publication registry schemas
The JDBC-based event publication registry support expects the following database schemas to be present in the database.
If you would like Spring Modulith to create the schema for you, set the application property spring.modulith.events.jdbc-schema-initialization.enabled
to true
.
H2
CREATE TABLE IF NOT EXISTS EVENT_PUBLICATION
(
ID UUID NOT NULL,
COMPLETION_DATE TIMESTAMP(9) WITH TIME ZONE,
EVENT_TYPE VARCHAR(512) NOT NULL,
LISTENER_ID VARCHAR(512) NOT NULL,
PUBLICATION_DATE TIMESTAMP(9) WITH TIME ZONE NOT NULL,
SERIALIZED_EVENT VARCHAR(4000) NOT NULL,
PRIMARY KEY (ID)
);
CREATE INDEX IF NOT EXISTS EVENT_PUBLICATION_BY_LISTENER_ID_AND_SERIALIZED_EVENT_IDX ON EVENT_PUBLICATION (LISTENER_ID, SERIALIZED_EVENT);
CREATE INDEX IF NOT EXISTS EVENT_PUBLICATION_BY_COMPLETION_DATE_IDX ON EVENT_PUBLICATION (COMPLETION_DATE);
HSQLDB
CREATE TABLE IF NOT EXISTS EVENT_PUBLICATION
(
ID UUID NOT NULL,
COMPLETION_DATE TIMESTAMP(9),
EVENT_TYPE VARCHAR(512) NOT NULL,
LISTENER_ID VARCHAR(512) NOT NULL,
PUBLICATION_DATE TIMESTAMP(9) NOT NULL,
SERIALIZED_EVENT VARCHAR(4000) NOT NULL,
PRIMARY KEY (ID)
);
CREATE INDEX IF NOT EXISTS EVENT_PUBLICATION_BY_LISTENER_ID_AND_SERIALIZED_EVENT_IDX ON EVENT_PUBLICATION (LISTENER_ID, SERIALIZED_EVENT);
CREATE INDEX IF NOT EXISTS EVENT_PUBLICATION_BY_COMPLETION_DATE_IDX ON EVENT_PUBLICATION (COMPLETION_DATE);
MariaDB
CREATE TABLE IF NOT EXISTS EVENT_PUBLICATION
(
ID VARCHAR(36) NOT NULL,
LISTENER_ID VARCHAR(512) NOT NULL,
EVENT_TYPE VARCHAR(512) NOT NULL,
SERIALIZED_EVENT VARCHAR(4000) NOT NULL,
PUBLICATION_DATE TIMESTAMP(6) NOT NULL,
COMPLETION_DATE TIMESTAMP(6) DEFAULT NULL NULL,
PRIMARY KEY (ID),
INDEX EVENT_PUBLICATION_BY_COMPLETION_DATE_IDX (COMPLETION_DATE)
);
Microsoft SQL Server
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'EVENT_PUBLICATION')
CREATE TABLE EVENT_PUBLICATION
(
ID VARCHAR(36) NOT NULL,
LISTENER_ID VARCHAR(512) NOT NULL,
EVENT_TYPE VARCHAR(512) NOT NULL,
SERIALIZED_EVENT VARCHAR(MAX) NOT NULL,
PUBLICATION_DATE DATETIME2(6) NOT NULL,
COMPLETION_DATE DATETIME2(6) NULL,
PRIMARY KEY (ID),
INDEX EVENT_PUBLICATION_BY_COMPLETION_DATE_IDX (COMPLETION_DATE)
);
MySQL
CREATE TABLE IF NOT EXISTS EVENT_PUBLICATION
(
ID VARCHAR(36) NOT NULL,
LISTENER_ID VARCHAR(512) NOT NULL,
EVENT_TYPE VARCHAR(512) NOT NULL,
SERIALIZED_EVENT VARCHAR(4000) NOT NULL,
PUBLICATION_DATE TIMESTAMP(6) NOT NULL,
COMPLETION_DATE TIMESTAMP(6) DEFAULT NULL NULL,
PRIMARY KEY (ID),
INDEX EVENT_PUBLICATION_BY_COMPLETION_DATE_IDX (COMPLETION_DATE)
);
PostgreSQL
CREATE TABLE IF NOT EXISTS event_publication
(
id UUID NOT NULL,
listener_id TEXT NOT NULL,
event_type TEXT NOT NULL,
serialized_event TEXT NOT NULL,
publication_date TIMESTAMP WITH TIME ZONE NOT NULL,
completion_date TIMESTAMP WITH TIME ZONE,
PRIMARY KEY (id)
);
CREATE INDEX IF NOT EXISTS event_publication_serialized_event_hash_idx ON event_publication USING hash(serialized_event);
CREATE INDEX IF NOT EXISTS event_publication_by_completion_date_idx ON event_publication (completion_date);
Appendix E: Migrating from Moduliths
-
o.m.model.Modules
has been renamed too.s.m.model.ApplicationModules
-
o.m.model.ModuleDetectionStrategy
has been renamed too.s.m.model.ApplicationModuleDetectionStrategy
-
@o.m.test.ModuleTest
has been renamed to@o.s.m.test.ApplicationModuleTest
-
o.m.docs.Documenter.Options
has been renamed too.s.m.docs.Documenter.DiagramOptions
-
The diagram style of component diagrams now defaults to
DiagramStyle.C4
(override by callingDiagramOptions.withStyle(DiagramStyle.UML)
) -
The module canvas hides non exposed types by default. To include application-module-internal types in the canvas, configure
CanvasOptions
to….revealInternals()
. -
The output folder for component diagrams and application module canvases has moved from
moduliths-docs
tospring-modulith-docs
located in your build’s target folder (such astarget
for Maven).