A consumer, subscribed to a queue

Hierarchy

  • AMQPConsumer

Constructors

Properties

channel: AMQPChannel
closed: boolean = false
closedError?: Error
onMessage: ((msg) => void)

Type declaration

rejectWait?: ((err) => void)

Type declaration

    • (err): void
    • Parameters

      • err: Error

      Returns void

resolveWait?: ((value) => void)

Type declaration

    • (value): void
    • Parameters

      • value: void

      Returns void

tag: string
timeoutId?: Timeout

Methods

  • Cancel/abort/stop the consumer. No more messages will be deliviered to the consumer. Note that any unacked messages are still unacked as they belong to the channel and not the consumer.

    Returns Promise<AMQPChannel>

  • Wait for the consumer to finish.

    Parameters

    • Optional timeout: number

      wait for this many milliseconds and then return regardless

    Returns Promise<void>

    Fulfilled when the consumer/channel/connection is closed by the client. Rejected if the timeout is hit.

Generated using TypeDoc