Options
All
  • Public
  • Public/Protected
  • All
Menu

@azure/core-amqp

Package version

Index

Type aliases

Func

Func<T, V>: (a: T) => V

Type declaration for a Function type where T is the input to the function and V is the output of the function.

Type parameters

  • T

  • V

Type declaration

    • (a: T): V
    • Parameters

      • a: T

      Returns V

ParsedOutput

ParsedOutput<T>: {}

Defines an object with possible properties defined in T.

Type parameters

  • T

Type declaration

Variables

Const Constants

Constants: { TLS: "tls"; aadEventHubsAudience: "https://eventhubs.azure.net/"; aadEventHubsScope: "https://eventhubs.azure.net//.default"; aadServiceBusAudience: "https://servicebus.azure.net/"; aadServiceBusScope: "https://servicebus.azure.net//.default"; aadTokenValidityMarginInMs: 5000; associatedLinkName: "associated-link-name"; attachEpoch: "com.microsoft:epoch"; cbsEndpoint: "$cbs"; cbsReplyTo: "cbs"; connectionError: "connection_error"; connectionReconnectDelay: 300; dateTimeOffset: "com.microsoft:datetime-offset"; deadLetterDescription: "deadletter-description"; deadLetterName: "com.microsoft:dead-letter"; deadLetterReason: "deadletter-reason"; deadLetterSource: "x-opt-deadletter-source"; defaultConnectionIdleTimeoutInMs: 60000; defaultConsumerGroup: "$default"; defaultDelayBetweenOperationRetriesInMs: 30000; defaultMaxDelayForExponentialRetryInMs: 90000; defaultMaxRetries: 3; defaultMaxRetriesForConnection: 150; defaultOperationTimeoutInMs: 60000; defaultPrefetchCount: 1000; dispositionStatus: "disposition-status"; enableReceiverRuntimeMetricName: "com.microsoft:enable-receiver-runtime-metric"; enqueueSequenceNumber: "x-opt-enqueue-sequence-number"; enqueuedTime: "x-opt-enqueued-time"; enqueuedTimeAnnotation: "amqp.annotation.x-opt-enqueued-time"; ensureContainerAndBlob: "ensureContainerAndBlob"; error: "error"; errorCondition: "error-condition"; establishConnection: "establishConnection"; eventHub: "eventhub"; fromSequenceNumber: "from-sequence-number"; guidSize: 16; lockTokenMapKey: "lock-token"; lockTokens: "lock-tokens"; lockedUntil: "x-opt-locked-until"; management: "$management"; managementRequestKey: "managementRequest"; maxAbsoluteExpiryTime: number; maxDeadLetterReasonLength: 4096; maxDurationValue: 922337203685477; maxMessageIdLength: 128; maxPartitionKeyLength: 128; maxSessionIdLength: 128; maxUserAgentLength: 512; maximumSqlFilterStatementLength: 1024; maximumSqlRuleActionStatementLength: 1024; message: "message"; messageCount: "message-count"; messageIdMapKey: "message-id"; minDurationValue: -922337203685477; negotiateCbsKey: "negotiateCbs"; negotiateClaim: "negotiateClaim"; offset: "x-opt-offset"; offsetAnnotation: "amqp.annotation.x-opt-offset"; operationPutToken: "put-token"; partition: "partition"; partitionId: "partitionId"; partitionIdName: "x-opt-partition-id"; partitionKey: "x-opt-partition-key"; pathDelimiter: "/"; propertiesToModify: "properties-to-modify"; publisher: "x-opt-publisher-name"; readOperation: "READ"; receiverError: "receiver_error"; receiverIdentifierName: "com.microsoft:receiver-name"; receiverSettleMode: "receiver-settle-mode"; reconnectLimit: 100; ruleNameMaximumLength: 50; scheduledEnqueueTime: "x-opt-scheduled-enqueue-time"; senderError: "sender_error"; sequenceNumber: "x-opt-sequence-number"; sequenceNumberAnnotation: "amqp.annotation.x-opt-sequence-number"; sequenceNumberMapKey: "sequence-number"; sequenceNumbers: "sequence-numbers"; serverTimeout: "com.microsoft:server-timeout"; sessionError: "session_error"; sessionFilterName: "com.microsoft:session-filter"; sessionIdMapKey: "session-id"; statusCode: "status-code"; statusDescription: "status-description"; timespan: "com.microsoft:timespan"; trackingId: "com.microsoft:tracking-id"; uri: "com.microsoft:uri"; vendorString: "com.microsoft"; viaPartitionKey: "x-opt-via-partition-key"; descriptorCodes: object; operations: object } = {associatedLinkName: "associated-link-name",partitionKey: "x-opt-partition-key",sequenceNumber: "x-opt-sequence-number",enqueueSequenceNumber: "x-opt-enqueue-sequence-number",enqueuedTime: "x-opt-enqueued-time",scheduledEnqueueTime: "x-opt-scheduled-enqueue-time",offset: "x-opt-offset",lockedUntil: "x-opt-locked-until",partitionIdName: "x-opt-partition-id",publisher: "x-opt-publisher-name",viaPartitionKey: "x-opt-via-partition-key",deadLetterSource: "x-opt-deadletter-source",enqueuedTimeAnnotation: `amqp.annotation.x-opt-enqueued-time`,offsetAnnotation: `amqp.annotation.x-opt-offset`,sequenceNumberAnnotation: `amqp.annotation.x-opt-sequence-number`,guidSize: 16,message: "message",error: "error",statusCode: "status-code",statusDescription: "status-description",errorCondition: "error-condition",management: "$management",partition: "partition",partitionId: "partitionId",readOperation: "READ",TLS: "tls",establishConnection: "establishConnection",defaultConsumerGroup: "$default",eventHub: "eventhub",cbsEndpoint: "$cbs",cbsReplyTo: "cbs",operationPutToken: "put-token",aadEventHubsAudience: "https://eventhubs.azure.net/",aadEventHubsScope: "https://eventhubs.azure.net//.default",aadServiceBusAudience: "https://servicebus.azure.net/",aadServiceBusScope: "https://servicebus.azure.net//.default",maxUserAgentLength: 512,vendorString: "com.microsoft",attachEpoch: `com.microsoft:epoch`,receiverIdentifierName: `com.microsoft:receiver-name`,enableReceiverRuntimeMetricName: `com.microsoft:enable-receiver-runtime-metric`,timespan: `com.microsoft:timespan`,uri: `com.microsoft:uri`,dateTimeOffset: `com.microsoft:datetime-offset`,sessionFilterName: `com.microsoft:session-filter`,receiverError: "receiver_error",senderError: "sender_error",sessionError: "session_error",connectionError: "connection_error",defaultOperationTimeoutInMs: 60000,defaultConnectionIdleTimeoutInMs: 60000,managementRequestKey: "managementRequest",negotiateCbsKey: "negotiateCbs",negotiateClaim: "negotiateClaim",ensureContainerAndBlob: "ensureContainerAndBlob",defaultPrefetchCount: 1000,reconnectLimit: 100,maxMessageIdLength: 128,maxPartitionKeyLength: 128,maxSessionIdLength: 128,pathDelimiter: "/",ruleNameMaximumLength: 50,maximumSqlFilterStatementLength: 1024,maximumSqlRuleActionStatementLength: 1024,maxDeadLetterReasonLength: 4096,// https://stackoverflow.com/questions/11526504/minimum-and-maximum-date for js// However we are setting this to the TimeSpan.MaxValue of C#.maxDurationValue: 922337203685477,minDurationValue: -922337203685477,// https://github.com/Azure/azure-amqp/blob/master/Microsoft.Azure.Amqp/Amqp/AmqpConstants.cs#L47maxAbsoluteExpiryTime: new Date("9999-12-31T07:59:59.000Z").getTime(),aadTokenValidityMarginInMs: 5000,connectionReconnectDelay: 300,defaultMaxRetries: 3,defaultMaxRetriesForConnection: 150,defaultDelayBetweenOperationRetriesInMs: 30000,defaultMaxDelayForExponentialRetryInMs: 90000,receiverSettleMode: "receiver-settle-mode",dispositionStatus: "disposition-status",fromSequenceNumber: "from-sequence-number",messageCount: "message-count",lockTokens: "lock-tokens",messageIdMapKey: "message-id",sequenceNumberMapKey: "sequence-number",lockTokenMapKey: "lock-token",sessionIdMapKey: "session-id",sequenceNumbers: "sequence-numbers",deadLetterReason: "deadletter-reason",deadLetterDescription: "deadletter-description",propertiesToModify: "properties-to-modify",deadLetterName: "com.microsoft:dead-letter",trackingId: "com.microsoft:tracking-id",serverTimeout: "com.microsoft:server-timeout",operations: {putToken: "put-token",read: "READ",cancelScheduledMessage: "com.microsoft:cancel-scheduled-message",scheduleMessage: "com.microsoft:schedule-message",renewLock: "com.microsoft:renew-lock",peekMessage: "com.microsoft:peek-message",receiveBySequenceNumber: "com.microsoft:receive-by-sequence-number",updateDisposition: "com.microsoft:update-disposition",renewSessionLock: "com.microsoft:renew-session-lock",setSessionState: "com.microsoft:set-session-state",getSessionState: "com.microsoft:get-session-state",enumerateSessions: "com.microsoft:get-message-sessions",addRule: "com.microsoft:add-rule",removeRule: "com.microsoft:remove-rule",enumerateRules: "com.microsoft:enumerate-rules"},descriptorCodes: {ruleDescriptionList: 1335734829060,sqlFilterList: 83483426822,correlationFilterList: 83483426825,sqlRuleActionList: 1335734829062,trueFilterList: 83483426823,falseFilterList: 83483426824}} as const

Type declaration

  • TLS: "tls"
  • aadEventHubsAudience: "https://eventhubs.azure.net/"
  • aadEventHubsScope: "https://eventhubs.azure.net//.default"
  • aadServiceBusAudience: "https://servicebus.azure.net/"
  • aadServiceBusScope: "https://servicebus.azure.net//.default"
  • aadTokenValidityMarginInMs: 5000
  • associatedLinkName: "associated-link-name"
  • attachEpoch: "com.microsoft:epoch"
  • cbsEndpoint: "$cbs"
  • cbsReplyTo: "cbs"
  • connectionError: "connection_error"
  • connectionReconnectDelay: 300
  • dateTimeOffset: "com.microsoft:datetime-offset"
  • deadLetterDescription: "deadletter-description"
  • deadLetterName: "com.microsoft:dead-letter"
  • deadLetterReason: "deadletter-reason"
  • deadLetterSource: "x-opt-deadletter-source"
  • defaultConnectionIdleTimeoutInMs: 60000
  • defaultConsumerGroup: "$default"
  • defaultDelayBetweenOperationRetriesInMs: 30000
  • defaultMaxDelayForExponentialRetryInMs: 90000
  • defaultMaxRetries: 3
  • defaultMaxRetriesForConnection: 150
  • defaultOperationTimeoutInMs: 60000
  • defaultPrefetchCount: 1000
  • dispositionStatus: "disposition-status"
  • enableReceiverRuntimeMetricName: "com.microsoft:enable-receiver-runtime-metric"
  • enqueueSequenceNumber: "x-opt-enqueue-sequence-number"
  • enqueuedTime: "x-opt-enqueued-time"
  • enqueuedTimeAnnotation: "amqp.annotation.x-opt-enqueued-time"
  • ensureContainerAndBlob: "ensureContainerAndBlob"
  • error: "error"
  • errorCondition: "error-condition"
  • establishConnection: "establishConnection"
  • eventHub: "eventhub"
  • fromSequenceNumber: "from-sequence-number"
  • guidSize: 16
  • lockTokenMapKey: "lock-token"
  • lockTokens: "lock-tokens"
  • lockedUntil: "x-opt-locked-until"
  • management: "$management"
  • managementRequestKey: "managementRequest"
  • maxAbsoluteExpiryTime: number
  • maxDeadLetterReasonLength: 4096
  • maxDurationValue: 922337203685477
  • maxMessageIdLength: 128
  • maxPartitionKeyLength: 128
  • maxSessionIdLength: 128
  • maxUserAgentLength: 512
  • maximumSqlFilterStatementLength: 1024
  • maximumSqlRuleActionStatementLength: 1024
  • message: "message"
  • messageCount: "message-count"
  • messageIdMapKey: "message-id"
  • minDurationValue: -922337203685477
  • negotiateCbsKey: "negotiateCbs"
  • negotiateClaim: "negotiateClaim"
  • offset: "x-opt-offset"
  • offsetAnnotation: "amqp.annotation.x-opt-offset"
  • operationPutToken: "put-token"
  • partition: "partition"
  • partitionId: "partitionId"
  • partitionIdName: "x-opt-partition-id"
  • partitionKey: "x-opt-partition-key"
  • pathDelimiter: "/"
  • propertiesToModify: "properties-to-modify"
  • publisher: "x-opt-publisher-name"
  • readOperation: "READ"
  • receiverError: "receiver_error"
  • receiverIdentifierName: "com.microsoft:receiver-name"
  • receiverSettleMode: "receiver-settle-mode"
  • reconnectLimit: 100
  • ruleNameMaximumLength: 50
  • scheduledEnqueueTime: "x-opt-scheduled-enqueue-time"
  • senderError: "sender_error"
  • sequenceNumber: "x-opt-sequence-number"
  • sequenceNumberAnnotation: "amqp.annotation.x-opt-sequence-number"
  • sequenceNumberMapKey: "sequence-number"
  • sequenceNumbers: "sequence-numbers"
  • serverTimeout: "com.microsoft:server-timeout"
  • sessionError: "session_error"
  • sessionFilterName: "com.microsoft:session-filter"
  • sessionIdMapKey: "session-id"
  • statusCode: "status-code"
  • statusDescription: "status-description"
  • timespan: "com.microsoft:timespan"
  • trackingId: "com.microsoft:tracking-id"
  • uri: "com.microsoft:uri"
  • vendorString: "com.microsoft"
  • viaPartitionKey: "x-opt-via-partition-key"
  • descriptorCodes: object
    • correlationFilterList: 83483426825
    • falseFilterList: 83483426824
    • ruleDescriptionList: 1335734829060
    • sqlFilterList: 83483426822
    • sqlRuleActionList: 1335734829062
    • trueFilterList: 83483426823
  • operations: object
    • addRule: "com.microsoft:add-rule"
    • cancelScheduledMessage: "com.microsoft:cancel-scheduled-message"
    • enumerateRules: "com.microsoft:enumerate-rules"
    • enumerateSessions: "com.microsoft:get-message-sessions"
    • getSessionState: "com.microsoft:get-session-state"
    • peekMessage: "com.microsoft:peek-message"
    • putToken: "put-token"
    • read: "READ"
    • receiveBySequenceNumber: "com.microsoft:receive-by-sequence-number"
    • removeRule: "com.microsoft:remove-rule"
    • renewLock: "com.microsoft:renew-lock"
    • renewSessionLock: "com.microsoft:renew-session-lock"
    • scheduleMessage: "com.microsoft:schedule-message"
    • setSessionState: "com.microsoft:set-session-state"
    • updateDisposition: "com.microsoft:update-disposition"

Const defaultLock

defaultLock: AsyncLock = new AsyncLock({ maxPending: 10000 })
constant

{AsyncLock} defaultLock The async lock instance with default settings.

Const isNode

isNode: boolean = !!process && !!process.version && !!process.versions && !!process.versions.node

A constant that indicates whether the environment is node.js or browser based.

Const logger

logger: any = createClientLogger("core-amqp")

The @azure/logger configuration for this package. This will output logs using the azure:event-hubs namespace prefix.

Const retryableErrors

retryableErrors: string[] = ["InternalServerError","ServerBusyError","ServiceUnavailableError","OperationCancelledError",// OperationTimeoutError occurs when the service fails to respond within a given timeframe.// Since reasons for such failures can be transient, this is treated as a retryable error."OperationTimeoutError","SenderBusyError","MessagingError","DetachForcedError","ConnectionForcedError","TransferLimitExceededError",// InsufficientCreditError occurs when the number of credits available on Rhea link is insufficient.// Since reasons for such shortage can be transient such as for pending delivery of messages, this is treated as a retryable error."InsufficientCreditError"]

Provides a list of retryable AMQP errors. "InternalServerError", "ServerBusyError", "ServiceUnavailableError", "OperationCancelledError", "SenderBusyError", "MessagingError", "DetachForcedError", "ConnectionForcedError", "TransferLimitExceededError"

Const rheaPromiseErrors

rheaPromiseErrors: string[] = [// OperationTimeoutError occurs when the service fails to respond within a given timeframe."OperationTimeoutError",// InsufficientCreditError occurs when the number of credits available on Rhea link is insufficient."InsufficientCreditError",// Defines the error that occurs when the Sender fails to send a message."SendOperationFailedError"]

Let self

self: Window & typeof globalThis & { navigator: Navigator }

Const systemErrorFieldsToCopy

systemErrorFieldsToCopy: ("address" | "code" | "errno" | "info" | "port" | "stack" | "syscall")[] = ["address","code","errno","info","port","stack","syscall"]

Functions

delay

  • delay<T>(delayInMs: number, abortSignal?: AbortSignalLike, abortErrorMsg?: undefined | string, value?: T): Promise<T>
  • A wrapper for setTimeout that resolves a promise after t milliseconds.

    Type parameters

    • T

    Parameters

    • delayInMs: number

      The number of milliseconds to be delayed.

    • Optional abortSignal: AbortSignalLike

      The abortSignal associated with containing operation.

    • Optional abortErrorMsg: undefined | string

      The abort error message associated with containing operation.

    • Optional value: T

      The value to be resolved with after a timeout of t milliseconds.

    Returns Promise<T>

    • Resolved promise

executePromisesSequentially

  • executePromisesSequentially(promiseFactories: Array<any>, kickstart?: any): Promise<any>

getNewAsyncLock

getReleaseInfo

  • getReleaseInfo(): string

isAmqpError

  • isAmqpError(error: any): error is AmqpError

isBrowserWebsocketError

  • isBrowserWebsocketError(err: any): boolean

isIotHubConnectionString

  • isIotHubConnectionString(connectionString: string): boolean

isSystemError

  • isSystemError(err: any): err is NetworkSystemError

parseConnectionString

  • parseConnectionString<T>(connectionString: string): ParsedOutput<T>
  • Parses the connection string and returns an object of type T.

    Connection strings have the following syntax:

    ConnectionString ::= Part { ";" Part } [ ";" ] [ WhiteSpace ] Part ::= [ PartLiteral [ "=" PartLiteral ] ] PartLiteral ::= [ WhiteSpace ] Literal [ WhiteSpace ] Literal ::= ? any sequence of characters except ; or = or WhiteSpace ? WhiteSpace ::= ? all whitespace characters including \r and \n ?

    Type parameters

    • T

    Parameters

    • connectionString: string

      The connection string to be parsed.

    Returns ParsedOutput<T>

    ParsedOutput.

randomNumberFromInterval

  • randomNumberFromInterval(min: number, max: number): number

retry

  • Every operation is attempted at least once. Additional attempts are made if the previous attempt failed with a retryable error. The number of additional attempts is governed by the maxRetries property provided on the RetryConfig argument.

    If mode option is set to Fixed, then the retries are made on the given operation for a specified number of times, with a fixed delay in between each retry each time.

    If mode option is set to Exponential, then the delay between retries is adjusted to increase exponentially with each attempt using back-off factor of power 2.

    Type parameters

    • T

    Parameters

    • config: RetryConfig<T>

      Parameters to configure retry operation

    Returns Promise<T>

    Promise.

translate

Object literals

Const ConnectionConfig

ConnectionConfig: object

Describes the ConnectionConfig module

module

ConnectionConfig

create

validate

Const ConnectionContextBase

ConnectionContextBase: object

create

Const EventHubConnectionConfig

EventHubConnectionConfig: object

Describes the connection config object that is created after parsing an EventHub connection string. It also provides some convenience methods for getting the address and audience for different entities.

module

EventHubConnectionConfig

create

createFromConnectionConfig

validate

Const MessageHeader

MessageHeader: object

Describes the operations that can be performed on the message header.

module

MessageHeader

fromAmqpMessageHeader

toAmqpMessageHeader

Const MessageProperties

MessageProperties: object

Describes the operations that can be performed on the amqp message properties.

module

MessageProperties

fromAmqpMessageProperties

toAmqpMessageProperties

Generated using TypeDoc