Skip to content

Introduce multi-tenancy extension#2

Draft
theoema wants to merge 2 commits intomainfrom
feature/multitenancy-extension
Draft

Introduce multi-tenancy extension#2
theoema wants to merge 2 commits intomainfrom
feature/multitenancy-extension

Conversation

@theoema
Copy link
Copy Markdown
Owner

@theoema theoema commented Mar 25, 2026

Summary

  • Multi-tenancy extension providing per-tenant isolation for CommandBus, QueryBus, EventStore, SnapshotStore, and event processors
  • Axon Server module for dynamic tenant discovery from server contexts
  • Spring Boot autoconfig that swaps standard processors with multi-tenant variants
  • TenantComponentFactory with subtype resolution for per-tenant dependency injection
  • Documentation guide with getting-started walkthrough

Dependencies

This PR depends on the snapshot store processing context propagation changes (commit 9674ad5fd9) which are part of an ongoing discussion. Not ready for merge until that is resolved.

Test plan

  • 186 unit tests passing
  • Embedded integration tests (MultiTenantEmbeddedIT)
  • Axon Server integration tests (MultiTenantAxonServerIT)
  • Documentation builds with zero errors
  • Code review pending

- Add @nullable ProcessingContext parameter to SnapshotStore.store()
  and SnapshotStore.load(), aligned with TokenStore's signature
- Add ProcessingContext parameter to Snapshotter.store() and
  Snapshotter.load() (non-null, internal interface always called
  from within a processing context)
- Pass ProcessingContext through from SnapshottingSourcingHandler
  to StoreBackedSnapshotter to SnapshotStore
- Update InMemorySnapshotStore and AxonServerSnapshotStore
  implementations
- Update StoreBackedSnapshotterTest and
  StoreBackedSnapshotterTestSuite
@theoema theoema force-pushed the feature/multitenancy-extension branch 4 times, most recently from 5100530 to 5406f37 Compare March 25, 2026 18:40
- Add axon-multitenancy module with per-tenant infrastructure isolation
  for CommandBus, QueryBus, EventStore, SnapshotStore, and event processors
- Add axon-multitenancy-axon-server module for dynamic tenant discovery
  from Axon Server contexts with runtime add/remove support
- Add MultiTenantEventProcessorModule with same fluent API as core
  PooledStreamingEventProcessorModule
- Add TenantResolverRegistry for per-message-type tenant resolution,
  aligned with DispatchInterceptorRegistry pattern from the core
- Add TenantComponentFactory with subtype resolution for automatic
  per-tenant dependency injection into message handlers
- Add TenantDescriptor parameter injection into handlers
- Add MetadataBasedTenantResolver for out-of-the-box tenant routing
- Add JDBC and JPA TenantTokenStoreFactory implementations
- Add Spring Boot autoconfig (MultiTenancyAutoConfiguration) that swaps
  standard processors with multi-tenant variants via ProcessorModuleFactory
- Add ConfigurationEnhancer SPI (MultiTenancyConfigurationDefaults) as
  single source of truth for multi-tenancy wiring
- Add multitenancy-guide documentation with getting-started walkthrough,
  event processor config, tenant component patterns, and Axon Server
  integration
- Add hints in reference guide (streaming processors, spring boot
  integration, modules, rdbms tuning, known issues)
- 186 unit and integration tests
@theoema theoema force-pushed the feature/multitenancy-extension branch from 5406f37 to 4c0928a Compare March 25, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant