Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface SessionReceiver<ReceivedMessageT>

Package version

A receiver that handles sessions, including renewing the session lock.

Type parameters

Hierarchy

  • Receiver<ReceivedMessageT>
    • SessionReceiver

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.

sessionId

sessionId: string

The session ID.

sessionLockedUntilUtc

sessionLockedUntilUtc: Date | undefined
property

The time in UTC until which the session is locked. Everytime renewSessionLock() is called, this time gets updated to current time plus the lock duration as specified during the Queue/Subscription creation.

Will return undefined until a AMQP receiver link has been successfully set up for the session.

readonly

Methods

close

  • close(): Promise<void>

getMessageIterator

getState

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.

renewSessionLock

setState

subscribe

Generated using TypeDoc