Repository navigation
Support Axoniq Framework multi-tenancy in the DLQ and entity inspection - #203
Open
stefanmirkovic wants to merge 2 commits into
Open
stefanmirkovic wants to merge 2 commits into
stefanmirkovic wants to merge 2 commits into
Conversation
With the multi-tenancy extension every tenant has its own dead-letter queue and event store, so the client listed, counted and changed dead letters of the default tenant only, and entity inspection could not find an entity that lives in a tenant. Dead-letter routes take an optional tenant. Listing without one pages across all tenants, using cached per-tenant sizes to load only the tenants that cover the requested page. Every operation runs in a unit of work from the configured UnitOfWorkFactory, bound to its tenant. The processor report counts dead letters per tenant, cached for 30 seconds; a change through this node drops the cache on this node only. It also lists each segment's position per tenant, read from the multi-tenant tracking token. Model inspection takes an optional tenant and otherwise looks the entity up in each tenant. Moves to Axoniq Framework 5.4.0, which the tenant-aware dead-letter processing needs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
With the multi-tenancy extension every tenant has its own dead-letter queue and event store. The client only saw the default tenant: it listed, counted and changed dead letters of that tenant alone, and entity inspection could not find an entity that lives in a tenant. Platform side: AxonIQ/axoniq-platform#1047.
What changes
Tenancy
PlatformTenancylists the tenants, binds a processing context to one tenant and reads per-tenant positions from a multi-tenant tracking token. It is free of multi-tenancy types and only active whenaxoniq-multi-tenancyis on the classpath, which the client takes as an optionalprovideddependency.UnitOfWorkFactory, bound to its tenant.Dead letters
tenant. Without one, listing pages across all tenants and uses cached per-tenant sizes to load only the tenants that cover the requested page; process and delete find the tenant that holds the letters.dlqSizePerTenant), cached for 30 seconds. A change through this node drops the cache on this node only.Positions
tenantPositions), read from the multi-tenant tracking token.positionstays their sum.Entity inspection
tenantand otherwise looks for the entity in each tenant.Versions
process(filter, context), which 5.3 does not have.Applications without multi-tenancy see no difference: no tenant on the routes, no per-tenant fields in the report.
Testing
DeadLetterManager: listing per tenant and across tenants, paging over tenant boundaries, the size cache and its invalidation, process and delete in the tenant that holds the letter, a sequence id that exists in two tenants (refused unless a tenant is named), one unit of work per tenant, and the single-tenant path unchanged.ProcessorReportCreator: positions per tenant next to their sum. The DLQ responder integration test covers the new payloads.axoniq-multi-tenancyoff the test classpath, because it switches itself on and then needs Axon Server; tests opt in explicitly.Not covered
Workflow inspection (#196) reads the event store without a tenant, so in a multi-tenant application it fails with "Tenant could not be resolved from the processing context". That needs its own change once #196 is merged.