Skip to content

[#211][#207] initial demo setup with declarative approach and springboot approach + command dispatching/handling - #4755

Merged
laura-devriendt-lemon merged 7 commits into
mainfrom
feature/axoniq/176/211_spring_boot_auto_configuration_demo
Jul 23, 2026
Merged

[#211][#207] initial demo setup with declarative approach and springboot approach + command dispatching/handling#4755
laura-devriendt-lemon merged 7 commits into
mainfrom
feature/axoniq/176/211_spring_boot_auto_configuration_demo

Conversation

@laura-devriendt-lemon

@laura-devriendt-lemon laura-devriendt-lemon commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Multi-tenancy example demos

Adds a set of runnable university examples under examples/university-multi-tenancy-examples
that demonstrate the Axoniq Framework 5 multi-tenancy support, so the feature has living
documentation and is exercised end to end.

Demonstrates #205 (tenant infrastructure), #207 and #211 (Spring Boot auto-configuration) at the moment.
Part of #176.

What the demo shows

  • Per-tenant component injection: one CourseStatsStore and one AuditLog instance per
    tenant, with the framework injecting the right tenant's instance into both a command
    handler and a query handler.
  • Tenant isolation: each tenant reads back only its own statistics.
  • Adding a tenant at runtime and having its per-tenant components appear on first use.
  • Rejecting a command dispatched for an unknown tenant.
  • routing commands via the correct tenant context
  • Closing a tenant's per-tenant instances when the tenant is removed and on shutdown.
  • Filtering the Axon Server _admin context out of the discovered tenants.
  • The configuration-time guardrail that rejects two providers for one component type.
  • Disabling multi-tenancy through axon.multitenancy.enabled=false.

Modules

The demo is split so a reader can pick the module matching the configuration style they
want to learn.

Module What it is
university-multi-tenancy-core The demo itself: the university model and the tenant lifecycle, independent of how the application is configured. A library, not runnable on its own.
university-multi-tenancy-declarative Runs the demo through the Configuration API. In memory by default, or against Axon Server via the demo.axon-server.enabled toggle.
university-multi-tenancy-springboot Runs the demo through Spring Boot auto-configuration, against Axon Server (tenants are Axon Server contexts).

Tests

  • MultiTenancyDemoTest (declarative): the tenant lifecycle end to end plus the
    provider-ambiguity guardrail.
  • MultiTenancyDisabledTest (Spring Boot): with multi-tenancy disabled, dispatching a tenant-scoped command fails at runtime.
  • MultiTenancyDemoIT (Spring Boot): boots Axon Server through Testcontainers and asserts
    the full lifecycle, including _admin filtering.

CI

The integration test needs a multi-context (Enterprise Edition) Axon Server, which requires
a license. A "Write Axon Server test license" step writes the AXON_SERVER_LICENSE secret
to the license file the test reads. The integration test runs in this repository's own pull
requests (where the secret is available) and locally (using a local license file), and skips
itself only where a license cannot be provided, such as fork pull requests. The license file
is git-ignored and never committed.

@laura-devriendt-lemon laura-devriendt-lemon added this to the Release 5.3.0 milestone Jul 16, 2026
@laura-devriendt-lemon laura-devriendt-lemon self-assigned this Jul 16, 2026
@laura-devriendt-lemon laura-devriendt-lemon added Type: Feature Use to signal an issue is completely new to the project. Priority 1: Must Highest priority. A release cannot be made if this issue isn’t resolved. labels Jul 16, 2026
@laura-devriendt-lemon
laura-devriendt-lemon force-pushed the feature/axoniq/176/211_spring_boot_auto_configuration_demo branch from e33f2e9 to 3460fb2 Compare July 17, 2026 09:52
@laura-devriendt-lemon
laura-devriendt-lemon marked this pull request as ready for review July 17, 2026 10:00
@laura-devriendt-lemon
laura-devriendt-lemon requested a review from a team as a code owner July 17, 2026 10:00
@laura-devriendt-lemon
laura-devriendt-lemon requested review from MateuszNaKodach, hatzlj and jangalinski and removed request for a team July 17, 2026 10:00
@hatzlj
hatzlj force-pushed the feature/axoniq/176/211_spring_boot_auto_configuration_demo branch from 3460fb2 to 6af3ed2 Compare July 21, 2026 11:04
@laura-devriendt-lemon
laura-devriendt-lemon force-pushed the feature/axoniq/176/211_spring_boot_auto_configuration_demo branch from 6af3ed2 to dbe0497 Compare July 22, 2026 14:52
@laura-devriendt-lemon laura-devriendt-lemon changed the title [#211] initial demo setup with declarative approach and springboot approach [#211][#207] initial demo setup with declarative approach and springboot approach + command dispatching/handling Jul 22, 2026

@hatzlj hatzlj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just one cosmetic correction regarding axon server

Comment thread examples/university-multi-tenancy-examples/README.md
Comment thread examples/university-multi-tenancy-examples/README.md
Comment thread examples/university-multi-tenancy-examples/README.md Outdated
@laura-devriendt-lemon
laura-devriendt-lemon force-pushed the feature/axoniq/176/211_spring_boot_auto_configuration_demo branch from 8c03762 to f539007 Compare July 23, 2026 07:35
@hatzlj
hatzlj force-pushed the feature/axoniq/176/211_spring_boot_auto_configuration_demo branch from f539007 to 3140572 Compare July 23, 2026 08:53
@laura-devriendt-lemon
laura-devriendt-lemon merged commit da21893 into main Jul 23, 2026
8 checks passed
@laura-devriendt-lemon
laura-devriendt-lemon deleted the feature/axoniq/176/211_spring_boot_auto_configuration_demo branch July 23, 2026 09:39

@smcvb smcvb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In all I love the structure an thoroughness. Definitely hope this helps people to comprehend how multi-tenancy works for Axon Framework. But, with 25 comments, I would've requested changes on this already merged PR.

Comment thread examples/university-multi-tenancy-examples/README.md
Comment thread .github/workflows/examples.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority 1: Must Highest priority. A release cannot be made if this issue isn’t resolved. Type: Feature Use to signal an issue is completely new to the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants