Interface Queue<TPublish, TReply>

Type Parameters

  • TPublish = unknown

  • TReply = unknown

Hierarchy

  • Queue

Properties

metaType: "queue"

Methods

  • Set an argument for a queue

    Parameters

    • name: string

      name of argument, ie x-max-in-memory-bytes

    • value: any

    Returns Queue<TPublish, TReply>

  • if true, the queue will be deleted when the number of consumers drops to zero (defaults to false)

    Parameters

    • Optional autoDelete: boolean

    Returns Queue<TPublish, TReply>

  • Add a dead letter exchange to route discarded messages to. A message is discarded for any of 4 reasons

    • Message expires
    • Queue limit is reached
    • Message is rejected (not implemented in Haredo)
    • Message is nacked with requeue set to false

    Parameters

    • dlx: string | Exchange<unknown>
    • Optional deadLetterRoutingKey: string

    Returns Queue<TPublish, TReply>

  • Set the limit of how many times a delivery can be done. Only available for quorum queues

    Parameters

    • limit: number

    Returns Queue<TPublish, TReply>

  • if true, the queue will survive broker restarts, modulo the effects of exclusive and autoDelete; this defaults to true if not supplied, unlike the others.

    Parameters

    • Optional durable: boolean

    Returns Queue<TPublish, TReply>

  • if true, scopes the queue to the connection (defaults to false)

    Parameters

    • Optional exclusive: boolean

    Returns Queue<TPublish, TReply>

  • the queue will be destroyed after n milliseconds of disuse, where use means having consumers or being declared

    Parameters

    • expires: number

    Returns Queue<TPublish, TReply>

  • set a maximum number of messages the queue will hold. Old messages will be discarded/dead lettered to make room for new ones

    Parameters

    • maxLength: number

    Returns Queue<TPublish, TReply>

  • Declare the queue as a priority queue and set the maximum priority the queue should support. Read more at rabbitmq.com

    Parameters

    • priority: number

      integer between 1 and 255

    Returns Queue<TPublish, TReply>

  • expires messages arriving in the queue after n milliseconds

    Parameters

    • messageTtl: number

    Returns Queue<TPublish, TReply>

  • Made for internal use. Mutates the state instead of doing the usual thing of returning a brand new object

    Parameters

    • name: string

    Returns void

  • set the name of the queue. Empty string will cause the server to assign a name for it.

    Parameters

    • name: string

    Returns Queue<TPublish, TReply>

  • Don't assert the queue (if queue doesn't exist then create it, if it exists but with a different configuration, then throw an error) but just check it (if queue doesn't exist then throw an error)

    Parameters

    • Optional passive: boolean

      true to do a checkQueue instead of assertQueue

    Returns Queue<TPublish, TReply>

  • Set the type of the queue. Available choices are 'classic' or 'quorum' (the latter available since RabbitMQ 3.8.0)

    Parameters

    • type: "classic" | "quorum"

    Returns Queue<TPublish, TReply>

Generated using TypeDoc