Axinom Mosaic Libraries
    Preparing search index...

    Type Parameters

    • TConfig

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    aggregateType: string

    The aggregate root type

    config: TConfig

    The service configuration object

    handlePreprocessor?: HandlePreprocessor<
        OutboxInboxHealthCheckCommand,
        Dict<unknown>,
    >

    A preprocessor that is called before the handleMessage and handleErrorMessagemethods. It can be used for validations and to provide an optional context.

    messageType: string

    The name of the message created for the aggregate type.

    messagingSettings: MessagingSettings

    The definitions of the message that is handled.

    Methods

    • Is called from the transactional inbox and calls the abstract handleMessage function with the correct message payload typing. Do not override this message but implement the handleMessage message.

      Parameters

      • message: StoredTransactionalMessage

        The inbox message with the payload to handle.

      • envOwnerClient: DatabaseClient

        The database client that is part of a DB env owner transaction to safely handle the inbox message.

      Returns Promise<void>

    • Is called from the transactional inbox and calls the handleErrorMessage function with the correct message payload typing. Do not override this message but override the handleErrorMessage message.

      Parameters

      • error: Error

        The error that was thrown in the handle method.

      • message: StoredTransactionalMessage

        The inbox message with the payload that was attempted to be handled.

      • envOwnerClient: DatabaseClient

        The database client that is part of a (new) transaction to safely handle the error.

      • retry: boolean

        True if the message will be retried again.

      Returns Promise<void>

      A flag that defines if the message should be retried ('transient_error') or not ('permanent_error')

    • Function to map a thrown error of an unspecified type to a potentially more human-readable error or remove unsafe properties.

      Parameters

      • error: Error

      Returns Error

    • Modifies the original error by extending its details subobject, if exists. Default behavior adds tenantId and environmentId to the details object by parsing the routing key. If still not available - returns original error. Some routing keys will not have tenantId and environmentId, e.g. when a command is sent. A separate handling is needed to extact these values, e.g. from the jwt.

      Parameters

      • error: Error & { details?: Record<string, unknown> }
      • message: StoredTransactionalMessage
      • Optional_context: Dict<unknown>

      Returns void