Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Receiver<ReceivedMessageT>

Package version

A receiver that does not handle sessions.

Type parameters

  • ReceivedMessageT

Hierarchy

Index

Properties

entityPath

entityPath: string

Path of the entity for which the receiver has been created.

isClosed

isClosed: boolean
property

Returns true if either the receiver or the client that created it has been closed

readonly

receiveMode

receiveMode: "peekLock" | "receiveAndDelete"

ReceiveMode provided to the client.

Methods

close

  • close(): Promise<void>

getMessageIterator

isReceivingMessages

  • isReceivingMessages(): boolean

peekMessages

  • Peek the next batch of active messages (including deferred but not deadlettered messages) on the queue or subscription without modifying them.

    • The first call to peekMessages() fetches the first active message. Each subsequent call fetches the subsequent message.
    • Unlike a "received" message, "peeked" message is a read-only version of the message. It cannot be Completed/Abandoned/Deferred/Deadlettered.

    Parameters

    • Optional options: PeekMessagesOptions

      Options that allow to specify the maximum number of messages to peek, the sequenceNumber to start peeking from or an abortSignal to abort the operation.

    Returns Promise<ReceivedMessage[]>

receiveBatch

  • receiveBatch(maxMessages: number, options?: ReceiveBatchOptions): Promise<ReceivedMessageT[]>

receiveDeferredMessage

  • receiveDeferredMessage(sequenceNumber: Long, options?: OperationOptions): Promise<ReceivedMessageT | undefined>
  • Returns a promise that resolves to a deferred message identified by the given sequenceNumber.

    throws

    Error if the underlying connection or receiver is closed.

    throws

    MessagingError if the service returns an error while receiving deferred message.

    Parameters

    • sequenceNumber: Long

      The sequence number of the message that needs to be received.

    • Optional options: OperationOptions

      Options bag to pass an abort signal or tracing options.

    Returns Promise<ReceivedMessageT | undefined>

    • Returns Message identified by sequence number.
    • Returns undefined if no such message is found.

receiveDeferredMessages

  • receiveDeferredMessages(sequenceNumbers: Long[], options?: OperationOptions): Promise<ReceivedMessageT[]>
  • Returns a promise that resolves to an array of deferred messages identified by given sequenceNumbers.

    throws

    Error if the underlying connection or receiver is closed.

    throws

    MessagingError if the service returns an error while receiving deferred messages.

    Parameters

    • sequenceNumbers: Long[]

      An array of sequence numbers for the messages that need to be received.

    • Optional options: OperationOptions

      Options bag to pass an abort signal or tracing options.

    Returns Promise<ReceivedMessageT[]>

    • Returns a list of messages identified by the given sequenceNumbers.
    • Returns an empty list if no messages are found.

subscribe

Generated using TypeDoc