Axinom Mosaic Libraries
    Preparing search index...

    Base class for message handlers to handle incoming messages from the subscribed queue. *

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    messageType: string
    middleware: OnMessageMiddleware<unknown>[]
    overrides?: SubscriptionConfig
    ownerPool: Pool
    storeInboxMessage: StoreInboxMessage

    Function to store the incoming RabbitMQ message in the transactional inbox

    Methods

    • Function to map thrown error of unspecified type to a more human-readable error. Defining this mapping function eliminates the need to wrap onMessage contents into an explicit try-catch block.

      Parameters

      • error: unknown

      Returns Error

    • Store the incoming message in the transactional inbox.

      Parameters

      Returns Promise<void>

    • Function that will be called after the last retry attempt has failed. Useful for handling errors in an explicit way.

      Parameters

      • payload: unknown

        non-binary message payload (usually a json)

      • message: MessageInfo<unknown>

        message with all related message metadata, including message envelope

      • error: Error

        error object that caused message processing to repeatedly fail

      Returns Promise<void>