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.

@FunctionalInterface public interface MultiTenantPersistentStreamIdResolver
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

    Fields
    Modifier and Type
    Field
    Description
    The default resolver, identifying every tenant's stream by the configured stream name as-is.
  • Method Summary

    Modifier and Type
    Method
    Description
    Resolves the stream id under which the persistent stream configured as name is opened in the Axon Server context of the given tenant.
  • Field Details

  • Method Details

    • resolve

      String resolve(String name, TenantDescriptor tenant)
      Resolves the stream id under which the persistent stream configured as name is opened in the Axon Server context of the given tenant.
      Parameters:
      name - the configured name of the persistent stream
      tenant - the tenant whose stream is opened
      Returns:
      the stream id to open the tenant's persistent stream under, never null or empty