[[appendix]]
= Appendix
:jdbc-schema-base: partial$spring-modulith-events-jdbc-src/main/resources

[appendix]
[[configuration-properties]]
== Spring Modulith Configuration Properties
[cols="2,1,3", options="header, unbreakable"]
|===
|Property|Default value|Description

|`spring.modulith.default-async-termination`
|`true`
|Whether to configure defaults for the async processing termination, namely to wait for task completion for 2 seconds. See `TaskExecutionProperties` for details.

|`spring.modulith.detection-strategy`
|none
|The strategy to be applied to detect application modules.
Can either be the class name of a custom implementation of `ApplicationModuleDetectionStrategy` or `direct-subpackages` (which is also the final fallback if nothing is configured) or `explicitly-annotated` to only select packages explicitly annotated with `@ApplicationModule` or jMolecules' `@Module`. See xref:fundamentals.adoc#customizing-modules[Customize Application Module Detection] for details.

|`spring.modulith.events.completion-mode`
|`UPDATE`
|How to mark event publications as completed. The default sets the completion date on the database entry, `DELETE` removes the entry right away. For details, see xref:events.adoc#publication-registry.completion[Event Publication Completion].

|`spring.modulith.events.externalization.enabled`
|`true`
|Whether to enable event externalization.

|`spring.modulith.events.jdbc.schema-initialization.enabled`
|`false`
|Whether to initialize the JDBC event publication schema.

|`spring.modulith.events.jdbc.schema`
|
|The schema name for the event publication table. If not specified, the table will not be schema-qualified.

|`spring.modulith.events.kafka.enable-json`
|`true`
|Whether to enable JSON support for `KafkaTemplate`.

|`spring.modulith.events.mongodb.transaction-management.enabled`
|`true`
|Whether to automatically enable transactions for MongoDB. Requires the database to be run with a replica set.

|`spring.modulith.events.neo4j.event-index.enabled`
|`false`
|Whether to create indexes on the .

|`spring.modulith.events.rabbitmq.enable-json`
|`true`
|Whether to enable JSON support for `RabbitTemplate`.

|`spring.modulith.events.republish-outstanding-events-on-restart`
|`false`
|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.

|`spring.modulith.moments.enableTimeMachine`
|`false`
|Whether to enable the xref:moments.adoc[`TimeMachine`].

|`spring.modulith.moments.granularity`
|`HOURS`
|The granularity of events to publish. (`HOURS`, `DAYS`)

|`spring.modulith.moments.locale`
|`Locale.getDefault()`
|The `Locale` to use when determining week boundaries.

|`spring.modulith.moments.zoneId`
|`ZoneOffset.UTC`
|The timezone of the dates for the events being published.

|`spring.modulith.republish-outstanding-events-on-restart`
|`false`
|Deprecated as of 1.3. Prefer `spring.modulith.events.republish-outstanding-events-on-restart`.

|`spring.modulith.test.file-modification-detector`
|none
|This can either be one of the predefined values `uncommitted-changes`, `reference-commit`, `default` or the fully-qualified class name of a `FileModificationDetector` that will be used to inspect which files of the projects have been changed.
As the name suggests, `uncommitted-changes` will only consider changed files not already committed.
`reference-commit` will consider all files changed since a given Git commit provided via `spring.modulith.test.reference-commit`, particularly useful CI environments in which that property could point to the commit hash of the last successful build.
`default` detects all uncomitted changes and ones that have not been pushed to the current branch's tracking branch which is primarily useful for local development.

|`spring.modulith.test.reference-commit`
|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]
[[artifacts]]
== Spring Modulith modules

.Spring Modulith starter POMs
[cols="2,1,3", options="header, unbreakable"]
|===
|Starter|Typical scope|Includes

|`spring-modulith-starter-core`
|`compile`
a|* `spring-modulith-api`
* `spring-modulith-apt`
* `spring-modulith-moments`
* `spring-modulith-core` (runtime)
* `spring-modulith-runtime` (runtime)

|`spring-modulith-starter-insight`
|`runtime`
a|* `spring-modulith-actuator` (runtime)
* `spring-modulith-observability` (runtime)
* `spring-boot-starter-actuator` (runtime)

|`spring-modulith-starter-jdbc`
|`compile`
a|* `spring-modulith-starter-core`
* `spring-modulith-events-api`
* `spring-modulith-events-core` (runtime)
* `spring-modulith-events-jdbc` (runtime)
* `spring-modulith-events-jackson` (runtime)

|`spring-modulith-starter-jpa`
|`compile`
a|* `spring-modulith-starter-core`
* `spring-modulith-events-api`
* `spring-modulith-events-core` (runtime)
* `spring-modulith-events-jpa` (runtime)
* `spring-modulith-events-jackson` (runtime)

|`spring-modulith-starter-mongodb`
|`compile`
a|* `spring-modulith-starter-core`
* `spring-modulith-events-api`
* `spring-modulith-events-core` (runtime)
* `spring-modulith-events-mongodb` (runtime)
* `spring-modulith-events-jackson` (runtime)

|`spring-modulith-starter-neo4j`
|`compile`
a|* `spring-modulith-starter-core`
* `spring-modulith-events-api`
* `spring-modulith-events-core` (runtime)
* `spring-modulith-events-neo4j` (runtime)
* `spring-modulith-events-jackson` (runtime)

|`spring-modulith-starter-test`
|`test`
a|* `spring-modulith-docs`
* `spring-modulith-test`
|===

.Individual Spring Modulith JARs
[cols="2,1,3", options="header, unbreakable"]
|===
|Module|Typical scope|Description
|`spring-modulith-actuator`|`runtime`|A Spring Boot actuator to expose the application module structure via an actuator.
|`spring-modulith-api`|`compile`|The abstractions to be used in your production code to customize Spring Modulith's default behavior.
|`spring-modulith-apt`|`compile`|An annotation processor to extract Javadoc for inclusion in xref:documentation.adoc#application-module-canvas[Application Module Canvases].
|`spring-modulith-core`|`runtime`|The core application module model and API.
|`spring-modulith-docs`|`test`|The `Documenter` API to create Asciidoctor and PlantUML documentation from the module model.
|`spring-modulith-events-amqp`|`runtime`|Event externalization support for AMQP.
|`spring-modulith-events-api`|`runtime`|API to customize the event features of Spring Modulith.
|`spring-modulith-events-core`|`runtime`|The core implementation of the event publication registry as well as the integration abstractions `EventPublicationRegistry` and `EventPublicationSerializer`.
|`spring-modulith-events-jackson`|`runtime`|A Jackson-based implementation of the `EventPublicationSerializer`.
|`spring-modulith-events-jdbc`|`runtime`|A JDBC-based implementation of the `EventPublicationRegistry`.
|`spring-modulith-events-jms`|`runtime`|Event externalization support for JMS.
|`spring-modulith-events-jpa`|`runtime`|A JPA-based implementation of the `EventPublicationRegistry`.
|`spring-modulith-events-kafka`|`runtime`|Event externalization support for Kafka.
|`spring-modulith-events-messaging`|`runtime`|Event externalization support into Spring Messaging ``MessageChannel``s.
|`spring-modulith-events-mongodb`|`runtime`|A MongoDB-based implementation of the `EventPublicationRegistry`.
|`spring-modulith-events-neo4j`|`runtime`|A Neo4j-based implementation of the `EventPublicationRegistry`.
|`spring-modulith-junit`|`test`|Test execution optimizations based on the application module structure. Find more details xref:testing.adoc#change-aware-test-execution[here].
|`spring-modulith-moments`|`compile`|The Passage of Time events implementation described xref:moments.adoc[here].
|`spring-modulith-observability`|`runtime`|Observability infrastructure described <<observability, here>>.
|`spring-modulith-runtime`|`runtime`|Support to bootstrap an `ApplicationModules` instance at runtime. Usually not directly depended on but transitively used by `spring-modulith-actuator` and `spring-modulith-observability`.
|`spring-modulith-test`|`test`|Integration testing support. Find more details xref:testing.adoc[here].
|===

[appendix]
[[deprecated-modules]]
== Deprecated modules

.Deprecated modules table
[cols="2,1,3", options="header, unbreakable"]
|===
|Module|Deprecated since|Description
|`spring-modulith-events-aws-sns`|`1.3`|Please migrate to `io.awspring.cloud:spring-cloud-aws-modulith-events-sns`. See https://github.com/awspring/spring-cloud-aws/tree/main/spring-cloud-aws-sns[this link]
|`spring-modulith-events-aws-sqs`|`1.3`|Please migrate to `io.awspring.cloud:spring-cloud-aws-modulith-events-sqs`. See https://github.com/awspring/spring-cloud-aws/tree/main/spring-cloud-aws-sqs[this link]
|===

[appendix]
[[schemas]]
== 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`.

[[schemas.h2]]
=== H2

[source, sql]
----
include::{jdbc-schema-base}/schema-h2.sql[]
----

[[schemas.hsqldb]]
=== HSQLDB

[source, sql]
----
include::{jdbc-schema-base}/schema-hsqldb.sql[]
----

[[schemas.mariadb]]
=== MariaDB

[source, sql]
----
include::{jdbc-schema-base}/schema-mariadb.sql[]
----

[[schemas.sqlserver]]
=== Microsoft SQL Server

[source, sql]
----
include::{jdbc-schema-base}/schema-sqlserver.sql[]
----

[[schemas.mysql]]
=== MySQL

[source, sql]
----
include::{jdbc-schema-base}/schema-mysql.sql[]
----

[[schemas.postgresql]]
=== PostgreSQL

[source, sql]
----
include::{jdbc-schema-base}/schema-postgresql.sql[]
----

[appendix]
[[migrating-from-moduliths]]
== Migrating from Moduliths


* `o.m.model.Modules` has been renamed to `o.s.m.model.ApplicationModules`
* `o.m.model.ModuleDetectionStrategy` has been renamed to `o.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 to `o.s.m.docs.Documenter.DiagramOptions`
* The diagram style of component diagrams now defaults to `DiagramStyle.C4` (override by calling `DiagramOptions.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` to `spring-modulith-docs` located in your build's target folder (such as `target` for Maven).
