Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MessageSender

Package version

internal

Describes the MessageSender that will send messages to ServiceBus.

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".

isConnecting

isConnecting: boolean = false
property

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

name

name: string
property

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

openLock

openLock: string = `sender-${generate_uuid()}`
property

{string} openLock The unique lock name per connection that is used to acquire the lock for establishing a sender link by an entity on that connection.

readonly

Methods

Protected _closeLink

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

Protected _ensureTokenRenewal

  • _ensureTokenRenewal(): Promise<void>

Protected _negotiateClaim

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

close

  • close(): Promise<void>

createBatch

getMaxMessageSize

  • getMaxMessageSize(options?: { retryOptions?: RetryOptions }): Promise<number>
  • Returns maximum message size on the AMQP sender link.

    Options to configure the createBatch method on the Sender.

    • maxSizeInBytes: The upper limit for the size of batch.

    Example usage:

    {
        retryOptions: { maxRetries: 5; timeoutInMs: 10 }
    }

    Parameters

    • Default value options: { retryOptions?: RetryOptions } = {}
      • Optional retryOptions?: RetryOptions

    Returns Promise<number>

isOpen

  • isOpen(): boolean

onDetached

  • onDetached(senderError?: AmqpError | Error): Promise<void>

open

  • open(options?: AwaitableSenderOptions): Promise<void>

send

sendBatch

sendMessages

Static create

Generated using TypeDoc