Interface HaredoMessage<TMessage, TReply>

Type Parameters

  • TMessage = unknown

  • TReply = unknown

Hierarchy

  • Methods<TReply>
    • HaredoMessage

Properties

appId?: string

An arbitrary identifier for the originating application

consumerTag?: string

consumerTag of the consumer the message originates from

contentEncoding?: string
contentType?: string
correlationId?: string

Used for RPC system to match messages to their replies

data: TMessage

Message contents

dataString: string

Unparsed message data

deliveryCount?: number

Amount of attempts the broker has done to deliver the message

deliveryMode?: 2 | 1

Either 1 for non-persistent or 2 for persistent

deliveryTag: number

deliveryTag of the message (used to identify the message between consumer and broker)

emitter: TypedEventEmitter<HaredoMessageEvents>
exchange?: string

Name of the exchange the message originates from

expiration?: number

If supplied, the message will be discarded from a queue once it’s been there longer than the given number of milliseconds

headers: MessagePropertyHeaders

Headers of the message

messageId?: string

Arbitrary application-specific identifier for the message

metaType: "message"
priority?: number

Priority of a message. See priority queues

queue: string

Name of the queue this message was consumed from

raw: Message

Raw message from amqplib

redelivered: boolean

True if the message has been sent to a consumer at least once

replyTo?: string

Queue name to reply to for RPC

routingKey?: string

Routingkey. If routingkey was not set then this equals to the name of the queue

timestamp?: number

A timestamp for the message

type?: string

An arbitrary application-specific type for the message

userId?: string

If supplied, RabbitMQ will compare it to the username supplied when opening the connection, and reject messages for which it does not match

Methods

  • Mark the message as done, removes it from the queue

    Returns void

  • Return the specified header

    Parameters

    • header: string

      header to return

    Returns string | string[]

  • Returns true if the message has been replied to (RPC)

    Returns boolean

  • Nack the message. If requeue is false (defaults to true) then the message will be discarded. Otherwise it will be returned to the front of the queue

    Parameters

    • Optional requeue: boolean

    Returns void

  • Reply to the message. Only works if the message has a replyTo and correlationId have been set on the message. If autoReply has been set on the chain, then You can just return a non-undefined value from the subscribe callback

    Parameters

    • message: TReply

    Returns Promise<void>

Generated using TypeDoc