Interface MultiTenantPersistentStreamIdResolver
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A functional interface resolving the stream id for a multi-tenant persistent stream from the supplied
configured name and
TenantDescriptor. This can be used to customize the identity of individual persistent
streams per tenant.
Implementations must be deterministic and stable across restarts: the stream id is the stream's identity on Axon Server, so resolving a different id for a tenant opens a new stream, which replays that tenant's events from the stream's initial position. Resolved ids must also be distinct per configured stream within one tenant, since sources sharing a stream id in the same context join the same server-side stream.
- Since:
- 5.4.1
- Author:
- Jakob Hatzl
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MultiTenantPersistentStreamIdResolverThe default resolver, identifying every tenant's stream by the configured stream name as-is. -
Method Summary
Modifier and TypeMethodDescriptionresolve(String name, TenantDescriptor tenant) Resolves the stream id under which the persistent stream configured asnameis opened in the Axon Server context of the giventenant.
-
Field Details
-
CONFIGURED_NAME
The default resolver, identifying every tenant's stream by the configured stream name as-is.
-
-
Method Details
-
resolve
Resolves the stream id under which the persistent stream configured asnameis opened in the Axon Server context of the giventenant.- Parameters:
name- the configured name of the persistent streamtenant- the tenant whose stream is opened- Returns:
- the stream id to open the tenant's persistent stream under, never
nullor empty
-