Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ManagementClient

Package version

internal

Hierarchy

Index

Constructors

constructor

Properties

Protected _context

property

{ClientEntityContext} _context Provides relevant information about the amqp connection, cbs and $management sessions, token provider, sender and receivers.

Protected Optional _tokenRenewalTimer

_tokenRenewalTimer: NodeJS.Timer
property

{NodeJS.Timer} _tokenRenewalTimer The token renewal timer that keeps track of when the Client Entity is due for token renewal.

Protected Optional _tokenTimeout

_tokenTimeout: undefined | number
property

_tokenTimeout Indicates token timeout

address

address: string
property

{string} address The client entity address in one of the following forms:

Sender

  • "<queue-name>".
  • "<topic-name>".

Receiver

  • "<queue-name>".
  • "<topic-name>".

ManagementClient -"$management".

audience

audience: string
property

{string} audience The client entity token audience in one of the following forms:

Sender

  • "sb://<yournamespace>.servicebus.windows.net/<queue-name>"
  • "sb://<yournamespace>.servicebus.windows.net/<topic-name>"

Receiver

  • "sb://<yournamespace>.servicebus.windows.net/<queue-name>"
  • "sb://<yournamespace>.servicebus.windows.net/<topic-name>"

ManagementClient

  • "sb://<your-namespace>.servicebus.windows.net/<queue-name>/$management".
  • "sb://<your-namespace>.servicebus.windows.net/<topic-name>/$management".

entityPath

entityPath: string
property

{string} entityPath - The name/path of the entity (queue/topic/subscription name) for which the management request needs to be made.

isConnecting

isConnecting: boolean = false
property

{boolean} isConnecting Indicates whether the link is in the process of connecting (establishing) itself. Default value: false.

managementLock

managementLock: string = `${Constants.managementRequestKey}-${generate_uuid()}`

name

name: string
property

{string} id The unique name for the entity in the format: ${name of the entity}-${guid}.

replyTo

replyTo: string = generate_uuid()
property

{string} replyTo The reply to Guid for the management client.

Methods

Protected _closeLink

  • _closeLink(link?: AwaitableSender | Receiver): Promise<void>

Protected _ensureTokenRenewal

  • _ensureTokenRenewal(): void

Protected _negotiateClaim

  • _negotiateClaim(setTokenRenewal?: undefined | false | true): Promise<void>

addRule

cancelScheduledMessages

  • cancelScheduledMessages(sequenceNumbers: Long[], options?: OperationOptionsBase & SendManagementRequestOptions): Promise<void>

close

  • close(): Promise<void>

getRules

getSessionState

  • getSessionState(sessionId: string, options?: OperationOptionsBase & SendManagementRequestOptions): Promise<any>

listMessageSessions

  • listMessageSessions(skip: number, top: number, lastUpdatedTime?: Date, options?: OperationOptionsBase & SendManagementRequestOptions): Promise<string[]>

peek

  • Fetches the next batch of active messages. The first call to peek() fetches the first active message for this client. Each subsequent call fetches the subsequent message in the entity.

    Unlike a received message, peeked message will not have lock token associated with it, and hence it cannot be Completed/Abandoned/Deferred/Deadlettered/Renewed. This method will also fetch even Deferred messages (but not Deadlettered message).

    Parameters

    • Optional messageCount: undefined | number
    • Optional options: OperationOptionsBase & SendManagementRequestOptions

    Returns Promise<ReceivedMessage[]>

    Promise<ReceivedSBMessage[]>

peekBySequenceNumber

  • peekBySequenceNumber(fromSequenceNumber: Long, maxMessageCount?: undefined | number, sessionId?: undefined | string, options?: OperationOptionsBase & SendManagementRequestOptions): Promise<ReceivedMessage[]>

peekMessagesBySession

  • Fetches the next batch of active messages in the current MessageSession. The first call to peek() fetches the first active message for this client. Each subsequent call fetches the subsequent message in the entity.

    Unlike a received message, peeked message will not have lock token associated with it, and hence it cannot be Completed/Abandoned/Deferred/Deadlettered/Renewed. This method will also fetch even Deferred messages (but not Deadlettered message).

    Parameters

    • sessionId: string

      The sessionId from which messages need to be peeked.

    • Optional messageCount: undefined | number
    • Optional options: OperationOptionsBase & SendManagementRequestOptions

    Returns Promise<ReceivedMessage[]>

    Promise<ReceivedMessageInfo[]>

receiveDeferredMessages

  • receiveDeferredMessages(sequenceNumbers: Long[], receiveMode: ReceiveMode, sessionId?: undefined | string, options?: OperationOptionsBase & SendManagementRequestOptions): Promise<ServiceBusMessageImpl[]>
  • Receives a list of deferred messages identified by sequenceNumbers.

    Parameters

    • sequenceNumbers: Long[]

      A list containing the sequence numbers to receive.

    • receiveMode: ReceiveMode

      The mode in which the receiver was created.

    • Optional sessionId: undefined | string
    • Optional options: OperationOptionsBase & SendManagementRequestOptions

    Returns Promise<ServiceBusMessageImpl[]>

    Promise<ServiceBusMessage[]>

    • Returns a list of messages identified by the given sequenceNumbers.
    • Returns an empty list if no messages are found.
    • Throws an error if the messages have not been deferred.

removeRule

  • removeRule(ruleName: string, options?: OperationOptionsBase & SendManagementRequestOptions): Promise<void>

renewLock

  • renewLock(lockToken: string, options?: SendManagementRequestOptions): Promise<Date>
  • Renews the lock on the message. The lock will be renewed based on the setting specified on the queue.

    When a message is received in PeekLock mode, the message is locked on the server for this receiver instance for a duration as specified during the Queue/Subscription creation (LockDuration). If processing of the message requires longer than this duration, the lock needs to be renewed. For each renewal, it resets the time the message is locked by the LockDuration set on the Entity.

    Parameters

    • lockToken: string

      Lock token of the message

    • Optional options: SendManagementRequestOptions

    Returns Promise<Date>

    Promise New lock token expiry date and time in UTC format.

renewSessionLock

  • renewSessionLock(sessionId: string, options?: OperationOptionsBase & SendManagementRequestOptions): Promise<Date>

scheduleMessages

setSessionState

  • setSessionState(sessionId: string, state: any, options?: OperationOptionsBase & SendManagementRequestOptions): Promise<void>

updateDispositionStatus

  • updateDispositionStatus(lockToken: string, dispositionType: DispositionType, options?: DispositionStatusOptions & SendManagementRequestOptions): Promise<void>

Generated using TypeDoc