Handles subscriptions to RabbitMQ queues and processing of messages using provided message handler and middleware functions.

Type Parameters

  • TContent

Hierarchy

  • default

Constructors

Properties

broker: BrokerAsPromised
handler: MessageHandler<TContent>
logger: Logger
middleware: OnMessageMiddleware<TContent>[] = []
session: undefined | SubscriberSessionAsPromised

Methods

  • Returns void

  • Parameters

    • message: Message

    Returns number

  • Parameters

    • content: Buffer

    Returns string | Record<string, unknown>

  • Returns Recovery | Recovery[]

  • Wrapper to call onMessage of a MessageHandler and make sure that message processing is completed.

    Parameters

    Returns Promise<void>

  • Parameters

    Returns Promise<void>

  • Parameters

    • error: Error

    Returns Promise<void>

  • Parameters

    • error: Error
    • message: Message
    • ackOrNack: AckOrNack

    Returns Promise<void>

  • Parameters

    • error: Error
    • message: Message
    • ackOrNack: AckOrNack

    Returns Promise<void>

  • Parameters

    • error: Error
    • message: Message
    • ackOrNack: AckOrNack

    Returns Promise<void>

  • Initializes a subscription and attaches session event handlers to it.

    Returns Promise<SubscriberSessionAsPromised>

Generated using TypeDoc