Skip to content

[#230] Decouple PersistentStreamConfigurationEnhancer from Spring - #794

Open
smcvb wants to merge 6 commits into
mainfrom
enhancement/230
Open

smcvb wants to merge 6 commits into
mainfrom
enhancement/230

Conversation

@smcvb

@smcvb smcvb commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

This pull request aims to improve the PersistentStreamConfigurationEnhancer slightly so.
It does roughly the following to achieve this:

  1. Introduce and use a PersistentStreamExecutorRegistry to contain all the ScheduledExecutorService instances of Persistent Stream sources. This provides a single place to shut down all executors on app shut down.
  2. Remove Spring dependencies from PersistentStreamConfigurationEnhancer, by dropping the DisposableBean and ObjectProvider dependencies. The former is possible due to the introduction of the PersistentStreamExecutorRegistry. The latter was easily replaced by a Supplier.
  3. Move the PersistentStreamConfigurationEnhancer and new PersistentStreamExecutorRegistry to the axon-server-connector module. None of this is Spring specific after all. The move makes it feasible to reuse the PersistentStreamConfigurationEnhancer for future other dependency injection framework integrations.
  4. Update JavaDoc when applicable
  5. Add more tests, especially for the enhancer, which had none of it's own

By doing the above, this PR resolves #230.

Introduce PersistentStreamExecutorRegistry. The registry provides us a
means to collectively close all the ScheduledExecutorServices for
PersistentStreams as part of Axon Framework's shutdown flow

#230
Configure a PersistentStreamExecutorRegistry when not present. The
shutdownAll is registered as a shutdown handler for the
ComponentDefinition

#230
Use registry to track executor. The shutdownAll is registered as a
shutdown handler for the ComponentDefinition

#230
Move Spring dependencies out of enhancer. This allows us to move the
enhancer to the persistent packaging, so it can be reused

#230
Move enhancer and registry to axon-server-connector. None of their
features are Spring specific, so they don't belong there anymore

#230
Add unit tests for PersistentStreamConfigurationEnhancer

#230
@smcvb smcvb added this to the Release 5.5.0 milestone Nov 17, 2026
@smcvb smcvb self-assigned this Nov 17, 2026
@smcvb
smcvb requested a review from a team as a code owner November 17, 2026 12:47
@smcvb smcvb added the Priority 3: Could Low priority. Issues that are nice to have but have a straightforward workaround. label Nov 17, 2026
@smcvb
smcvb removed the request for review from a team November 17, 2026 12:47
@smcvb smcvb added the Type: Enhancement Use to signal an issue enhances an already existing feature of the project. label Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Build status (run 44086388672, commit 85c2d60)

JDK 21 - SUCCESS - 33 modules (23 cached, 10 built) in 14:56

Per-module details
ModuleCacheTime
✅ axoniq-frameworkcached00:01
✅ axoniq-test-loggingcached00:01
✅ axoniq-framework-parentcached00:04
✅ axoniq-framework-bomcached00:00
✅ axoniq-postgresqlcached00:03
✅ axoniq-distributed-messagingcached00:00
✅ axoniq-testcontainercached00:00
✅ axon-server-connectorbuilt02:13
✅ axoniq-springcloudcached00:00
✅ axoniq-dead-lettercached00:00
✅ axoniq-event-streamingcached00:00
✅ axoniq-multi-tenancybuilt00:21
✅ axoniq-workflow-parentcached00:00
✅ axoniq-workflow-enginecached00:00
✅ axoniq-tracing-micrometercached00:00
✅ axoniq-workflow-dslcached00:00
✅ axoniq-workflow-testcached00:00
✅ axoniq-framework-springcached00:00
✅ axoniq-spring-boot-autoconfigurebuilt01:49
✅ axoniq-spring-boot-starterbuilt00:00
✅ axoniq-integrationtestscached00:00
✅ axoniq-integrationtests-supportbuilt00:01
✅ axoniq-integrationtests-connectorcached00:00
✅ axoniq-integrationtests-conformancebuilt03:43
✅ axoniq-integrationtests-tracingbuilt00:10
✅ axoniq-integrationtests-dead-letterbuilt00:03
✅ axoniq-legacycached00:01
✅ axoniq-integrationtests-legacycached00:00
✅ axoniq-integrationtests-workflowbuilt00:34
✅ axoniq-legacy-testcached00:00
✅ axoniq-message-transformationcached00:00
✅ axoniq-workflow-dsl-kotlincached00:01
✅ axoniq-docs-samplesbuilt00:10

JDK 25 - UNKNOWN - no per-module data found; the build likely did not complete (e.g. timed out or was cancelled) -- check the build step's own log

Per-module details
ModuleCacheTime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority 3: Could Low priority. Issues that are nice to have but have a straightforward workaround. Type: Enhancement Use to signal an issue enhances an already existing feature of the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shut down persistent stream executors through the framework lifecycle

1 participant