Interface TenantResolver

All Known Implementing Classes:
MetadataBasedTenantResolver

public interface TenantResolver
Resolves the target tenant of a given Message, and attaches a tenant to a Message in the inverse direction.

A message dispatched from within a handler generally does not name its own tenant: the tenant is only known through the ProcessingContext of the message being handled. attachTenant(Message, TenantDescriptor) is what makes that tenant survive the message being dispatched elsewhere, for example across a distributed command or query bus that carries the message to another process and back. A resolver that only resolves, and never attaches, silently drops the tenant on every such dispatch, with no signal that anything is missing until a receiving component fails to resolve a tenant it should have had.

Since:
4.6.0
Author:
Stefan Dragisic, Jan Galinski, Jakob Hatzl