@azure/event-hubs 6.0.2-alpha.20251015.1 → 6.0.2-alpha.20251021.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/batchingPartitionChannel.d.ts.map +1 -1
- package/dist/browser/batchingPartitionChannel.js +2 -1
- package/dist/browser/batchingPartitionChannel.js.map +1 -1
- package/dist/browser/connectionContext.d.ts.map +1 -1
- package/dist/browser/connectionContext.js +10 -4
- package/dist/browser/connectionContext.js.map +1 -1
- package/dist/browser/eventHubBufferedProducerClient.d.ts.map +1 -1
- package/dist/browser/eventHubBufferedProducerClient.js +2 -1
- package/dist/browser/eventHubBufferedProducerClient.js.map +1 -1
- package/dist/browser/eventHubConsumerClient.d.ts.map +1 -1
- package/dist/browser/eventHubConsumerClient.js +3 -6
- package/dist/browser/eventHubConsumerClient.js.map +1 -1
- package/dist/browser/eventHubProducerClient.d.ts.map +1 -1
- package/dist/browser/eventHubProducerClient.js +3 -6
- package/dist/browser/eventHubProducerClient.js.map +1 -1
- package/dist/browser/eventHubSender.d.ts.map +1 -1
- package/dist/browser/eventHubSender.js +6 -4
- package/dist/browser/eventHubSender.js.map +1 -1
- package/dist/browser/partitionReceiver.js +4 -4
- package/dist/browser/partitionReceiver.js.map +1 -1
- package/dist/browser/util/timerLoop.d.ts.map +1 -1
- package/dist/browser/util/timerLoop.js +12 -5
- package/dist/browser/util/timerLoop.js.map +1 -1
- package/dist/commonjs/batchingPartitionChannel.d.ts.map +1 -1
- package/dist/commonjs/batchingPartitionChannel.js +2 -1
- package/dist/commonjs/batchingPartitionChannel.js.map +1 -1
- package/dist/commonjs/connectionContext.d.ts.map +1 -1
- package/dist/commonjs/connectionContext.js +10 -4
- package/dist/commonjs/connectionContext.js.map +1 -1
- package/dist/commonjs/eventHubBufferedProducerClient.d.ts.map +1 -1
- package/dist/commonjs/eventHubBufferedProducerClient.js +2 -1
- package/dist/commonjs/eventHubBufferedProducerClient.js.map +1 -1
- package/dist/commonjs/eventHubConsumerClient.d.ts.map +1 -1
- package/dist/commonjs/eventHubConsumerClient.js +3 -6
- package/dist/commonjs/eventHubConsumerClient.js.map +1 -1
- package/dist/commonjs/eventHubProducerClient.d.ts.map +1 -1
- package/dist/commonjs/eventHubProducerClient.js +3 -6
- package/dist/commonjs/eventHubProducerClient.js.map +1 -1
- package/dist/commonjs/eventHubSender.d.ts.map +1 -1
- package/dist/commonjs/eventHubSender.js +6 -4
- package/dist/commonjs/eventHubSender.js.map +1 -1
- package/dist/commonjs/partitionReceiver.js +4 -4
- package/dist/commonjs/partitionReceiver.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/commonjs/util/timerLoop.d.ts.map +1 -1
- package/dist/commonjs/util/timerLoop.js +12 -5
- package/dist/commonjs/util/timerLoop.js.map +1 -1
- package/dist/esm/batchingPartitionChannel.d.ts.map +1 -1
- package/dist/esm/batchingPartitionChannel.js +2 -1
- package/dist/esm/batchingPartitionChannel.js.map +1 -1
- package/dist/esm/connectionContext.d.ts.map +1 -1
- package/dist/esm/connectionContext.js +10 -4
- package/dist/esm/connectionContext.js.map +1 -1
- package/dist/esm/eventHubBufferedProducerClient.d.ts.map +1 -1
- package/dist/esm/eventHubBufferedProducerClient.js +2 -1
- package/dist/esm/eventHubBufferedProducerClient.js.map +1 -1
- package/dist/esm/eventHubConsumerClient.d.ts.map +1 -1
- package/dist/esm/eventHubConsumerClient.js +3 -6
- package/dist/esm/eventHubConsumerClient.js.map +1 -1
- package/dist/esm/eventHubProducerClient.d.ts.map +1 -1
- package/dist/esm/eventHubProducerClient.js +3 -6
- package/dist/esm/eventHubProducerClient.js.map +1 -1
- package/dist/esm/eventHubSender.d.ts.map +1 -1
- package/dist/esm/eventHubSender.js +6 -4
- package/dist/esm/eventHubSender.js.map +1 -1
- package/dist/esm/partitionReceiver.js +4 -4
- package/dist/esm/partitionReceiver.js.map +1 -1
- package/dist/esm/util/timerLoop.d.ts.map +1 -1
- package/dist/esm/util/timerLoop.js +12 -5
- package/dist/esm/util/timerLoop.js.map +1 -1
- package/dist/react-native/batchingPartitionChannel.d.ts +94 -0
- package/dist/react-native/batchingPartitionChannel.d.ts.map +1 -0
- package/dist/react-native/batchingPartitionChannel.js +255 -0
- package/dist/react-native/batchingPartitionChannel.js.map +1 -0
- package/dist/react-native/connectionContext.d.ts +108 -0
- package/dist/react-native/connectionContext.d.ts.map +1 -0
- package/dist/react-native/connectionContext.js +310 -0
- package/dist/react-native/connectionContext.js.map +1 -0
- package/dist/react-native/dataTransformer.d.ts +53 -0
- package/dist/react-native/dataTransformer.d.ts.map +1 -0
- package/dist/react-native/dataTransformer.js +133 -0
- package/dist/react-native/dataTransformer.js.map +1 -0
- package/dist/react-native/diagnostics/instrumentEventData.d.ts +28 -0
- package/dist/react-native/diagnostics/instrumentEventData.d.ts.map +1 -0
- package/dist/react-native/diagnostics/instrumentEventData.js +67 -0
- package/dist/react-native/diagnostics/instrumentEventData.js.map +1 -0
- package/dist/react-native/diagnostics/tracing.d.ts +19 -0
- package/dist/react-native/diagnostics/tracing.d.ts.map +1 -0
- package/dist/react-native/diagnostics/tracing.js +40 -0
- package/dist/react-native/diagnostics/tracing.js.map +1 -0
- package/dist/react-native/eventData.d.ts +295 -0
- package/dist/react-native/eventData.d.ts.map +1 -0
- package/dist/react-native/eventData.js +247 -0
- package/dist/react-native/eventData.js.map +1 -0
- package/dist/react-native/eventDataAdapter.d.ts +69 -0
- package/dist/react-native/eventDataAdapter.d.ts.map +1 -0
- package/dist/react-native/eventDataAdapter.js +38 -0
- package/dist/react-native/eventDataAdapter.js.map +1 -0
- package/dist/react-native/eventDataBatch.d.ts +225 -0
- package/dist/react-native/eventDataBatch.d.ts.map +1 -0
- package/dist/react-native/eventDataBatch.js +301 -0
- package/dist/react-native/eventDataBatch.js.map +1 -0
- package/dist/react-native/eventHubBufferedProducerClient.d.ts +323 -0
- package/dist/react-native/eventHubBufferedProducerClient.d.ts.map +1 -0
- package/dist/react-native/eventHubBufferedProducerClient.js +301 -0
- package/dist/react-native/eventHubBufferedProducerClient.js.map +1 -0
- package/dist/react-native/eventHubConsumerClient.d.ts +293 -0
- package/dist/react-native/eventHubConsumerClient.d.ts.map +1 -0
- package/dist/react-native/eventHubConsumerClient.js +336 -0
- package/dist/react-native/eventHubConsumerClient.js.map +1 -0
- package/dist/react-native/eventHubConsumerClientModels.d.ts +218 -0
- package/dist/react-native/eventHubConsumerClientModels.d.ts.map +1 -0
- package/dist/react-native/eventHubConsumerClientModels.js +4 -0
- package/dist/react-native/eventHubConsumerClientModels.js.map +1 -0
- package/dist/react-native/eventHubProducerClient.d.ts +299 -0
- package/dist/react-native/eventHubProducerClient.d.ts.map +1 -0
- package/dist/react-native/eventHubProducerClient.js +366 -0
- package/dist/react-native/eventHubProducerClient.js.map +1 -0
- package/dist/react-native/eventHubSender.d.ts +227 -0
- package/dist/react-native/eventHubSender.d.ts.map +1 -0
- package/dist/react-native/eventHubSender.js +626 -0
- package/dist/react-native/eventHubSender.js.map +1 -0
- package/dist/react-native/eventPosition.d.ts +73 -0
- package/dist/react-native/eventPosition.d.ts.map +1 -0
- package/dist/react-native/eventPosition.js +121 -0
- package/dist/react-native/eventPosition.js.map +1 -0
- package/dist/react-native/eventProcessor.d.ts +232 -0
- package/dist/react-native/eventProcessor.d.ts.map +1 -0
- package/dist/react-native/eventProcessor.js +389 -0
- package/dist/react-native/eventProcessor.js.map +1 -0
- package/dist/react-native/eventhubConnectionConfig.d.ts +96 -0
- package/dist/react-native/eventhubConnectionConfig.d.ts.map +1 -0
- package/dist/react-native/eventhubConnectionConfig.js +98 -0
- package/dist/react-native/eventhubConnectionConfig.js.map +1 -0
- package/dist/react-native/impl/awaitableQueue.d.ts +25 -0
- package/dist/react-native/impl/awaitableQueue.d.ts.map +1 -0
- package/dist/react-native/impl/awaitableQueue.js +51 -0
- package/dist/react-native/impl/awaitableQueue.js.map +1 -0
- package/dist/react-native/impl/partitionAssigner.d.ts +29 -0
- package/dist/react-native/impl/partitionAssigner.d.ts.map +1 -0
- package/dist/react-native/impl/partitionAssigner.js +52 -0
- package/dist/react-native/impl/partitionAssigner.js.map +1 -0
- package/dist/react-native/impl/partitionGate.d.ts +27 -0
- package/dist/react-native/impl/partitionGate.d.ts.map +1 -0
- package/dist/react-native/impl/partitionGate.js +38 -0
- package/dist/react-native/impl/partitionGate.js.map +1 -0
- package/dist/react-native/impl/partitionKeyToIdMapper.d.ts +6 -0
- package/dist/react-native/impl/partitionKeyToIdMapper.d.ts.map +1 -0
- package/dist/react-native/impl/partitionKeyToIdMapper.js +111 -0
- package/dist/react-native/impl/partitionKeyToIdMapper.js.map +1 -0
- package/dist/react-native/inMemoryCheckpointStore.d.ts +44 -0
- package/dist/react-native/inMemoryCheckpointStore.d.ts.map +1 -0
- package/dist/react-native/inMemoryCheckpointStore.js +94 -0
- package/dist/react-native/inMemoryCheckpointStore.js.map +1 -0
- package/dist/react-native/index.d.ts +21 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +12 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/loadBalancerStrategies/balancedStrategy.d.ts +30 -0
- package/dist/react-native/loadBalancerStrategies/balancedStrategy.d.ts.map +1 -0
- package/dist/react-native/loadBalancerStrategies/balancedStrategy.js +40 -0
- package/dist/react-native/loadBalancerStrategies/balancedStrategy.js.map +1 -0
- package/dist/react-native/loadBalancerStrategies/greedyStrategy.d.ts +24 -0
- package/dist/react-native/loadBalancerStrategies/greedyStrategy.d.ts.map +1 -0
- package/dist/react-native/loadBalancerStrategies/greedyStrategy.js +29 -0
- package/dist/react-native/loadBalancerStrategies/greedyStrategy.js.map +1 -0
- package/dist/react-native/loadBalancerStrategies/loadBalancingStrategy.d.ts +28 -0
- package/dist/react-native/loadBalancerStrategies/loadBalancingStrategy.d.ts.map +1 -0
- package/dist/react-native/loadBalancerStrategies/loadBalancingStrategy.js +245 -0
- package/dist/react-native/loadBalancerStrategies/loadBalancingStrategy.js.map +1 -0
- package/dist/react-native/loadBalancerStrategies/unbalancedStrategy.d.ts +20 -0
- package/dist/react-native/loadBalancerStrategies/unbalancedStrategy.d.ts.map +1 -0
- package/dist/react-native/loadBalancerStrategies/unbalancedStrategy.js +22 -0
- package/dist/react-native/loadBalancerStrategies/unbalancedStrategy.js.map +1 -0
- package/dist/react-native/logger.d.ts +37 -0
- package/dist/react-native/logger.d.ts.map +1 -0
- package/dist/react-native/logger.js +56 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/managementClient.d.ts +145 -0
- package/dist/react-native/managementClient.d.ts.map +1 -0
- package/dist/react-native/managementClient.js +305 -0
- package/dist/react-native/managementClient.js.map +1 -0
- package/dist/react-native/models/private.d.ts +185 -0
- package/dist/react-native/models/private.d.ts.map +1 -0
- package/dist/react-native/models/private.js +4 -0
- package/dist/react-native/models/private.js.map +1 -0
- package/dist/react-native/models/public.d.ts +240 -0
- package/dist/react-native/models/public.d.ts.map +1 -0
- package/dist/react-native/models/public.js +18 -0
- package/dist/react-native/models/public.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/partitionProcessor.d.ts +134 -0
- package/dist/react-native/partitionProcessor.d.ts.map +1 -0
- package/dist/react-native/partitionProcessor.js +137 -0
- package/dist/react-native/partitionProcessor.js.map +1 -0
- package/dist/react-native/partitionPump.d.ts +38 -0
- package/dist/react-native/partitionPump.d.ts.map +1 -0
- package/dist/react-native/partitionPump.js +175 -0
- package/dist/react-native/partitionPump.js.map +1 -0
- package/dist/react-native/partitionReceiver.d.ts +82 -0
- package/dist/react-native/partitionReceiver.d.ts.map +1 -0
- package/dist/react-native/partitionReceiver.js +335 -0
- package/dist/react-native/partitionReceiver.js.map +1 -0
- package/dist/react-native/pumpManager.d.ts +72 -0
- package/dist/react-native/pumpManager.d.ts.map +1 -0
- package/dist/react-native/pumpManager.js +120 -0
- package/dist/react-native/pumpManager.js.map +1 -0
- package/dist/react-native/util/connectionStringUtils.d.ts +52 -0
- package/dist/react-native/util/connectionStringUtils.d.ts.map +1 -0
- package/dist/react-native/util/connectionStringUtils.js +48 -0
- package/dist/react-native/util/connectionStringUtils.js.map +1 -0
- package/dist/react-native/util/constants.d.ts +25 -0
- package/dist/react-native/util/constants.d.ts.map +1 -0
- package/dist/react-native/util/constants.js +27 -0
- package/dist/react-native/util/constants.js.map +1 -0
- package/dist/react-native/util/delayWithoutThrow.d.ts +8 -0
- package/dist/react-native/util/delayWithoutThrow.d.ts.map +1 -0
- package/dist/react-native/util/delayWithoutThrow.js +17 -0
- package/dist/react-native/util/delayWithoutThrow.js.map +1 -0
- package/dist/react-native/util/error.d.ts +39 -0
- package/dist/react-native/util/error.d.ts.map +1 -0
- package/dist/react-native/util/error.js +103 -0
- package/dist/react-native/util/error.js.map +1 -0
- package/dist/react-native/util/getPromiseParts.d.ts +10 -0
- package/dist/react-native/util/getPromiseParts.d.ts.map +1 -0
- package/dist/react-native/util/getPromiseParts.js +20 -0
- package/dist/react-native/util/getPromiseParts.js.map +1 -0
- package/dist/react-native/util/operationOptions.d.ts +16 -0
- package/dist/react-native/util/operationOptions.d.ts.map +1 -0
- package/dist/react-native/util/operationOptions.js +4 -0
- package/dist/react-native/util/operationOptions.js.map +1 -0
- package/dist/react-native/util/parseEndpoint.d.ts +11 -0
- package/dist/react-native/util/parseEndpoint.d.ts.map +1 -0
- package/dist/react-native/util/parseEndpoint.js +17 -0
- package/dist/react-native/util/parseEndpoint.js.map +1 -0
- package/dist/react-native/util/retries.d.ts +6 -0
- package/dist/react-native/util/retries.d.ts.map +1 -0
- package/dist/react-native/util/retries.js +13 -0
- package/dist/react-native/util/retries.js.map +1 -0
- package/dist/react-native/util/runtimeInfo-react-native.d.mts.map +1 -0
- package/dist/react-native/util/runtimeInfo-react-native.mjs.map +1 -0
- package/dist/react-native/util/runtimeInfo.d.ts +6 -0
- package/dist/react-native/util/runtimeInfo.js +20 -0
- package/dist/react-native/util/timerLoop.d.ts +26 -0
- package/dist/react-native/util/timerLoop.d.ts.map +1 -0
- package/dist/react-native/util/timerLoop.js +34 -0
- package/dist/react-native/util/timerLoop.js.map +1 -0
- package/dist/react-native/util/typeGuards.d.ts +8 -0
- package/dist/react-native/util/typeGuards.d.ts.map +1 -0
- package/dist/react-native/util/typeGuards.js +12 -0
- package/dist/react-native/util/typeGuards.js.map +1 -0
- package/dist/react-native/util/utils.d.ts +7 -0
- package/dist/react-native/util/utils.d.ts.map +1 -0
- package/dist/react-native/util/utils.js +13 -0
- package/dist/react-native/util/utils.js.map +1 -0
- package/dist/react-native/withAuth.d.ts +25 -0
- package/dist/react-native/withAuth.d.ts.map +1 -0
- package/dist/react-native/withAuth.js +84 -0
- package/dist/react-native/withAuth.js.map +1 -0
- package/package.json +16 -11
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { AbortError } from "@azure/abort-controller";
|
|
4
|
+
import { PartitionProcessor } from "./partitionProcessor.js";
|
|
5
|
+
import { isEventPosition, latestEventPosition } from "./eventPosition.js";
|
|
6
|
+
import { PumpManagerImpl } from "./pumpManager.js";
|
|
7
|
+
import { logErrorStackTrace, logger } from "./logger.js";
|
|
8
|
+
import { CloseReason } from "./models/public.js";
|
|
9
|
+
import { delayWithoutThrow } from "./util/delayWithoutThrow.js";
|
|
10
|
+
import { getRandomName } from "./util/utils.js";
|
|
11
|
+
import { StandardAbortMessage } from "@azure/core-amqp";
|
|
12
|
+
/**
|
|
13
|
+
* Event Processor based applications consist of one or more instances of EventProcessor which have been
|
|
14
|
+
* configured to consume events from the same Event Hub and consumer group. They balance the
|
|
15
|
+
* workload across different instances by distributing the partitions to be processed among themselves.
|
|
16
|
+
* They also allow the user to track progress when events are processed using checkpoints.
|
|
17
|
+
*
|
|
18
|
+
* A checkpoint is meant to represent the last successfully processed event by the user from a particular
|
|
19
|
+
* partition of a consumer group in an Event Hub instance.
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export class EventProcessor {
|
|
24
|
+
_consumerGroup;
|
|
25
|
+
_context;
|
|
26
|
+
_subscriptionEventHandlers;
|
|
27
|
+
_checkpointStore;
|
|
28
|
+
_processorOptions;
|
|
29
|
+
_pumpManager;
|
|
30
|
+
_id;
|
|
31
|
+
_isRunning = false;
|
|
32
|
+
_loopTask;
|
|
33
|
+
_abortController;
|
|
34
|
+
/**
|
|
35
|
+
* A specific partition to target.
|
|
36
|
+
*/
|
|
37
|
+
_processingTarget;
|
|
38
|
+
/**
|
|
39
|
+
* Determines which partitions to claim as part of load balancing.
|
|
40
|
+
*/
|
|
41
|
+
_loadBalancingStrategy;
|
|
42
|
+
/**
|
|
43
|
+
* The amount of time between load balancing attempts.
|
|
44
|
+
*/
|
|
45
|
+
_loopIntervalInMs;
|
|
46
|
+
_eventHubName;
|
|
47
|
+
_fullyQualifiedNamespace;
|
|
48
|
+
/**
|
|
49
|
+
* @param consumerGroup - The name of the consumer group from which you want to process events.
|
|
50
|
+
* @param eventHubClient - An instance of `EventHubClient` that was created for the Event Hub instance.
|
|
51
|
+
* @param PartitionProcessorClass - A user-provided class that extends the `PartitionProcessor` class.
|
|
52
|
+
* This class will be responsible for processing and checkpointing events.
|
|
53
|
+
* @param checkpointStore - An instance of `CheckpointStore`. See @azure/eventhubs-checkpointstore-blob for an implementation.
|
|
54
|
+
* For production, choose an implementation that will store checkpoints and partition ownership details to a durable store.
|
|
55
|
+
* @param options - A set of options to configure the Event Processor
|
|
56
|
+
* - `maxBatchSize` : The max size of the batch of events passed each time to user code for processing.
|
|
57
|
+
* - `maxWaitTimeInSeconds` : The maximum amount of time to wait to build up the requested message count before
|
|
58
|
+
* passing the data to user code for processing. If not provided, it defaults to 60 seconds.
|
|
59
|
+
*/
|
|
60
|
+
constructor(_consumerGroup, _context, _subscriptionEventHandlers, _checkpointStore, options) {
|
|
61
|
+
this._consumerGroup = _consumerGroup;
|
|
62
|
+
this._context = _context;
|
|
63
|
+
this._subscriptionEventHandlers = _subscriptionEventHandlers;
|
|
64
|
+
this._checkpointStore = _checkpointStore;
|
|
65
|
+
if (options.ownerId) {
|
|
66
|
+
this._id = options.ownerId;
|
|
67
|
+
logger.verbose(`Starting event processor with ID ${this._id}`);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
this._id = getRandomName();
|
|
71
|
+
logger.verbose(`Starting event processor with autogenerated ID ${this._id}`);
|
|
72
|
+
}
|
|
73
|
+
this._eventHubName = this._context.config.entityPath;
|
|
74
|
+
this._fullyQualifiedNamespace = this._context.config.host;
|
|
75
|
+
this._processorOptions = options;
|
|
76
|
+
this._pumpManager =
|
|
77
|
+
options.pumpManager || new PumpManagerImpl(this._id, this._processorOptions);
|
|
78
|
+
this._processingTarget = options.processingTarget;
|
|
79
|
+
this._loopIntervalInMs = options.loopIntervalInMs;
|
|
80
|
+
this._loadBalancingStrategy = options.loadBalancingStrategy;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The unique identifier for the EventProcessor.
|
|
84
|
+
*/
|
|
85
|
+
get id() {
|
|
86
|
+
return this._id;
|
|
87
|
+
}
|
|
88
|
+
_createPartitionOwnershipRequest(partitionOwnershipMap, partitionIdToClaim) {
|
|
89
|
+
const previousPartitionOwnership = partitionOwnershipMap.get(partitionIdToClaim);
|
|
90
|
+
const partitionOwnership = {
|
|
91
|
+
ownerId: this._id,
|
|
92
|
+
partitionId: partitionIdToClaim,
|
|
93
|
+
fullyQualifiedNamespace: this._fullyQualifiedNamespace,
|
|
94
|
+
consumerGroup: this._consumerGroup,
|
|
95
|
+
eventHubName: this._eventHubName,
|
|
96
|
+
etag: previousPartitionOwnership ? previousPartitionOwnership.etag : undefined,
|
|
97
|
+
};
|
|
98
|
+
return partitionOwnership;
|
|
99
|
+
}
|
|
100
|
+
/*
|
|
101
|
+
* Claim ownership of the given partition if it's available
|
|
102
|
+
*/
|
|
103
|
+
async _claimOwnership(ownershipRequest, abortSignal) {
|
|
104
|
+
if (abortSignal.aborted) {
|
|
105
|
+
logger.verbose(`[${this._id}] Subscription was closed before claiming ownership of ${ownershipRequest.partitionId}.`);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
logger.info(`[${this._id}] Attempting to claim ownership of partition ${ownershipRequest.partitionId}.`);
|
|
109
|
+
try {
|
|
110
|
+
const claimedOwnerships = await this._checkpointStore.claimOwnership([ownershipRequest]);
|
|
111
|
+
// can happen if the partition was claimed out from underneath us - we shouldn't
|
|
112
|
+
// attempt to spin up a processor.
|
|
113
|
+
if (!claimedOwnerships.length) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
logger.info(`[${this._id}] Successfully claimed ownership of partition ${ownershipRequest.partitionId}.`);
|
|
117
|
+
await this._startPump(ownershipRequest.partitionId, abortSignal);
|
|
118
|
+
}
|
|
119
|
+
catch (err) {
|
|
120
|
+
logger.warning(`[${this._id}] Failed to claim ownership of partition ${ownershipRequest.partitionId}`);
|
|
121
|
+
logErrorStackTrace(err);
|
|
122
|
+
await this._handleSubscriptionError(err);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
async _startPump(partitionId, abortSignal) {
|
|
126
|
+
if (abortSignal.aborted) {
|
|
127
|
+
logger.verbose(`[${this._id}] The subscription was closed before starting to read from ${partitionId}.`);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (this._pumpManager.isReceivingFromPartition(partitionId)) {
|
|
131
|
+
logger.verbose(`[${this._id}] There is already an active partitionPump for partition "${partitionId}", skipping pump creation.`);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
logger.verbose(`[${this._id}] [${partitionId}] Calling user-provided PartitionProcessorFactory.`);
|
|
135
|
+
const partitionProcessor = new PartitionProcessor(this._subscriptionEventHandlers, this._checkpointStore, {
|
|
136
|
+
fullyQualifiedNamespace: this._fullyQualifiedNamespace,
|
|
137
|
+
eventHubName: this._eventHubName,
|
|
138
|
+
consumerGroup: this._consumerGroup,
|
|
139
|
+
partitionId: partitionId,
|
|
140
|
+
eventProcessorId: this._id,
|
|
141
|
+
});
|
|
142
|
+
const eventPosition = await this._getStartingPosition(partitionId);
|
|
143
|
+
await this._pumpManager.createPump(eventPosition, this._context, partitionProcessor, abortSignal);
|
|
144
|
+
logger.verbose(`[${this._id}] PartitionPump created successfully.`);
|
|
145
|
+
}
|
|
146
|
+
async _getStartingPosition(partitionIdToClaim) {
|
|
147
|
+
const availableCheckpoints = await this._checkpointStore.listCheckpoints(this._fullyQualifiedNamespace, this._eventHubName, this._consumerGroup);
|
|
148
|
+
const validCheckpoints = availableCheckpoints.filter((chk) => chk.partitionId === partitionIdToClaim);
|
|
149
|
+
if (validCheckpoints.length > 0) {
|
|
150
|
+
return { offset: validCheckpoints[0].offset };
|
|
151
|
+
}
|
|
152
|
+
logger.verbose(`No checkpoint found for partition ${partitionIdToClaim}. Looking for fallback.`);
|
|
153
|
+
return getStartPosition(partitionIdToClaim, this._processorOptions.startPosition);
|
|
154
|
+
}
|
|
155
|
+
async _runLoopForSinglePartition(partitionId, abortSignal) {
|
|
156
|
+
while (!abortSignal.aborted) {
|
|
157
|
+
try {
|
|
158
|
+
await this._startPump(partitionId, abortSignal);
|
|
159
|
+
}
|
|
160
|
+
catch (err) {
|
|
161
|
+
logger.warning(`[${this._id}] An error occurred within the EventProcessor loop: ${err?.name}: ${err?.message}`);
|
|
162
|
+
logErrorStackTrace(err);
|
|
163
|
+
await this._handleSubscriptionError(err);
|
|
164
|
+
}
|
|
165
|
+
finally {
|
|
166
|
+
// sleep for some time after which we can attempt to create a pump again.
|
|
167
|
+
logger.verbose(`[${this._id}] Pausing the EventProcessor loop for ${this._loopIntervalInMs} ms.`);
|
|
168
|
+
// swallow errors from delay since it's fine for delay to exit early
|
|
169
|
+
await delayWithoutThrow(this._loopIntervalInMs, abortSignal);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
this._isRunning = false;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Every loop to this method will result in this EventProcessor owning at most one new partition.
|
|
176
|
+
*
|
|
177
|
+
* The load is considered balanced when no active EventProcessor owns 2 partitions more than any other active
|
|
178
|
+
* EventProcessor. Given that each invocation to this method results in ownership claim of at most one partition,
|
|
179
|
+
* this algorithm converges gradually towards a steady state.
|
|
180
|
+
*
|
|
181
|
+
* When a new partition is claimed, this method is also responsible for starting a partition pump that creates an
|
|
182
|
+
* EventHubConsumer for processing events from that partition.
|
|
183
|
+
*/
|
|
184
|
+
async _runLoopWithLoadBalancing(loadBalancingStrategy, abortSignal) {
|
|
185
|
+
let cancelLoopResolver;
|
|
186
|
+
// This provides a mechanism for exiting the loop early
|
|
187
|
+
// if the subscription has had `close` called.
|
|
188
|
+
const cancelLoopPromise = new Promise((resolve) => {
|
|
189
|
+
cancelLoopResolver = resolve;
|
|
190
|
+
if (abortSignal.aborted) {
|
|
191
|
+
resolve();
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
abortSignal.addEventListener("abort", resolve);
|
|
195
|
+
});
|
|
196
|
+
// Periodically check if any partitions need to be claimed and claim them.
|
|
197
|
+
while (!abortSignal.aborted) {
|
|
198
|
+
const iterationStartTimeInMs = Date.now();
|
|
199
|
+
try {
|
|
200
|
+
const { partitionIds } = await this._context.managementSession.getEventHubProperties({
|
|
201
|
+
abortSignal,
|
|
202
|
+
});
|
|
203
|
+
await this._performLoadBalancing(loadBalancingStrategy, partitionIds, abortSignal);
|
|
204
|
+
}
|
|
205
|
+
catch (err) {
|
|
206
|
+
logger.warning(`[${this._id}] An error occurred within the EventProcessor loop: ${err?.name}: ${err?.message}`);
|
|
207
|
+
logErrorStackTrace(err);
|
|
208
|
+
// Protect against the scenario where the user awaits on subscription.close() from inside processError.
|
|
209
|
+
await Promise.race([this._handleSubscriptionError(err), cancelLoopPromise]);
|
|
210
|
+
}
|
|
211
|
+
finally {
|
|
212
|
+
// Sleep for some time, then continue the loop.
|
|
213
|
+
const iterationDeltaInMs = Date.now() - iterationStartTimeInMs;
|
|
214
|
+
const delayDurationInMs = Math.max(this._loopIntervalInMs - iterationDeltaInMs, 0);
|
|
215
|
+
logger.verbose(`[${this._id}] Pausing the EventProcessor loop for ${delayDurationInMs} ms.`);
|
|
216
|
+
// Swallow the error since it's fine to exit early from the delay.
|
|
217
|
+
await delayWithoutThrow(delayDurationInMs, abortSignal);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
if (cancelLoopResolver) {
|
|
221
|
+
abortSignal.removeEventListener("abort", cancelLoopResolver);
|
|
222
|
+
}
|
|
223
|
+
this._isRunning = false;
|
|
224
|
+
}
|
|
225
|
+
async _performLoadBalancing(loadBalancingStrategy, partitionIds, abortSignal) {
|
|
226
|
+
if (abortSignal.aborted)
|
|
227
|
+
throw new AbortError(StandardAbortMessage);
|
|
228
|
+
// Retrieve current partition ownership details from the datastore.
|
|
229
|
+
const partitionOwnership = await this._checkpointStore.listOwnership(this._fullyQualifiedNamespace, this._eventHubName, this._consumerGroup);
|
|
230
|
+
if (abortSignal.aborted)
|
|
231
|
+
throw new AbortError(StandardAbortMessage);
|
|
232
|
+
const { partitionOwnershipMap, partitionsToClaim } = computePartitionsToClaim({
|
|
233
|
+
id: this._id,
|
|
234
|
+
isReceivingFromPartition: (partitionId) => this._pumpManager.isReceivingFromPartition(partitionId),
|
|
235
|
+
loadBalancingStrategy,
|
|
236
|
+
partitionIds,
|
|
237
|
+
partitionOwnership,
|
|
238
|
+
});
|
|
239
|
+
for (const partitionToClaim of partitionsToClaim) {
|
|
240
|
+
const partitionOwnershipRequest = this._createPartitionOwnershipRequest(partitionOwnershipMap, partitionToClaim);
|
|
241
|
+
await this._claimOwnership(partitionOwnershipRequest, abortSignal);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* This is called when there are errors that are not specific to a partition (ex: load balancing)
|
|
246
|
+
*/
|
|
247
|
+
async _handleSubscriptionError(err) {
|
|
248
|
+
// filter out any internal "expected" errors
|
|
249
|
+
if (err.name === "AbortError") {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
if (this._subscriptionEventHandlers.processError) {
|
|
253
|
+
try {
|
|
254
|
+
await this._subscriptionEventHandlers.processError(err, {
|
|
255
|
+
fullyQualifiedNamespace: this._fullyQualifiedNamespace,
|
|
256
|
+
eventHubName: this._eventHubName,
|
|
257
|
+
consumerGroup: this._consumerGroup,
|
|
258
|
+
partitionId: "",
|
|
259
|
+
updateCheckpoint: async () => {
|
|
260
|
+
/* no-op */
|
|
261
|
+
},
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
catch (errorFromUser) {
|
|
265
|
+
logger.verbose(`[${this._id}] An error was thrown from the user's processError handler: ${errorFromUser}`);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Starts the `EventProcessor`. Based on the number of instances of `EventProcessor` that are running for the
|
|
271
|
+
* same consumer group, the partitions are distributed among these instances to process events.
|
|
272
|
+
*
|
|
273
|
+
* For each partition, the user provided `PartitionProcessor` is instantiated.
|
|
274
|
+
*
|
|
275
|
+
* Subsequent calls to start will be ignored if this event processor is already running.
|
|
276
|
+
* Calling `start()` after `stop()` is called will restart this event processor.
|
|
277
|
+
*
|
|
278
|
+
*/
|
|
279
|
+
start() {
|
|
280
|
+
if (this._isRunning) {
|
|
281
|
+
logger.verbose(`[${this._id}] Attempted to start an already running EventProcessor.`);
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
this._isRunning = true;
|
|
285
|
+
this._abortController = new AbortController();
|
|
286
|
+
logger.verbose(`[${this._id}] Starting an EventProcessor.`);
|
|
287
|
+
if (this._processingTarget) {
|
|
288
|
+
logger.verbose(`[${this._id}] Single partition target: ${this._processingTarget}`);
|
|
289
|
+
this._loopTask = this._runLoopForSinglePartition(this._processingTarget, this._abortController.signal);
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
logger.verbose(`[${this._id}] Multiple partitions, using load balancer`);
|
|
293
|
+
this._loopTask = this._runLoopWithLoadBalancing(this._loadBalancingStrategy, this._abortController.signal);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
isRunning() {
|
|
297
|
+
return this._isRunning;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Stops processing events for all partitions owned by this event processor.
|
|
301
|
+
* All `PartitionProcessor` will be shutdown and any open resources will be closed.
|
|
302
|
+
*
|
|
303
|
+
* Subsequent calls to stop will be ignored if the event processor is not running.
|
|
304
|
+
*
|
|
305
|
+
*/
|
|
306
|
+
async stop() {
|
|
307
|
+
logger.verbose(`[${this._id}] Stopping an EventProcessor.`);
|
|
308
|
+
// cancel the event processor loop
|
|
309
|
+
this._abortController?.abort();
|
|
310
|
+
try {
|
|
311
|
+
// remove all existing pumps
|
|
312
|
+
await this._pumpManager.removeAllPumps(CloseReason.Shutdown);
|
|
313
|
+
// waits for the event processor loop to complete
|
|
314
|
+
// will complete immediately if _loopTask is undefined
|
|
315
|
+
if (this._loopTask) {
|
|
316
|
+
await this._loopTask;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
catch (err) {
|
|
320
|
+
logger.verbose(`[${this._id}] An error occurred while stopping the EventProcessor: ${err}`);
|
|
321
|
+
}
|
|
322
|
+
finally {
|
|
323
|
+
logger.verbose(`[${this._id}] EventProcessor stopped.`);
|
|
324
|
+
}
|
|
325
|
+
if (this._processingTarget) {
|
|
326
|
+
logger.verbose(`[${this._id}] No partitions owned, skipping abandoning.`);
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
await this.abandonPartitionOwnerships();
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
async abandonPartitionOwnerships() {
|
|
333
|
+
logger.verbose(`[${this._id}] Abandoning owned partitions`);
|
|
334
|
+
const allOwnerships = await this._checkpointStore.listOwnership(this._fullyQualifiedNamespace, this._eventHubName, this._consumerGroup);
|
|
335
|
+
const ourOwnerships = allOwnerships.filter((ownership) => ownership.ownerId === this._id);
|
|
336
|
+
// unclaim any partitions that we currently own
|
|
337
|
+
for (const ownership of ourOwnerships) {
|
|
338
|
+
ownership.ownerId = "";
|
|
339
|
+
}
|
|
340
|
+
return this._checkpointStore.claimOwnership(ourOwnerships);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
function isAbandoned(ownership) {
|
|
344
|
+
return ownership.ownerId === "";
|
|
345
|
+
}
|
|
346
|
+
function getStartPosition(partitionIdToClaim, startPositions) {
|
|
347
|
+
if (startPositions == null) {
|
|
348
|
+
return latestEventPosition;
|
|
349
|
+
}
|
|
350
|
+
if (isEventPosition(startPositions)) {
|
|
351
|
+
return startPositions;
|
|
352
|
+
}
|
|
353
|
+
const startPosition = startPositions[partitionIdToClaim];
|
|
354
|
+
if (startPosition == null) {
|
|
355
|
+
return latestEventPosition;
|
|
356
|
+
}
|
|
357
|
+
return startPosition;
|
|
358
|
+
}
|
|
359
|
+
function computePartitionsToClaim(inputs) {
|
|
360
|
+
const { partitionOwnership, id, isReceivingFromPartition, loadBalancingStrategy, partitionIds } = inputs;
|
|
361
|
+
const partitionOwnershipMap = new Map();
|
|
362
|
+
const nonAbandonedPartitionOwnershipMap = new Map();
|
|
363
|
+
const partitionsToRenew = [];
|
|
364
|
+
// Separate abandoned ownerships from claimed ownerships.
|
|
365
|
+
// We only want to pass active partition ownerships to the
|
|
366
|
+
// load balancer, but we need to hold onto the abandoned
|
|
367
|
+
// partition ownerships because we need the etag to claim them.
|
|
368
|
+
for (const ownership of partitionOwnership) {
|
|
369
|
+
partitionOwnershipMap.set(ownership.partitionId, ownership);
|
|
370
|
+
if (!isAbandoned(ownership)) {
|
|
371
|
+
nonAbandonedPartitionOwnershipMap.set(ownership.partitionId, ownership);
|
|
372
|
+
}
|
|
373
|
+
if (ownership.ownerId === id && isReceivingFromPartition(ownership.partitionId)) {
|
|
374
|
+
partitionsToRenew.push(ownership.partitionId);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
// Pass the list of all the partition ids and the collection of claimed partition ownerships
|
|
378
|
+
// to the load balance strategy.
|
|
379
|
+
// The load balancing strategy only needs to know the full list of partitions,
|
|
380
|
+
// and which of those are currently claimed.
|
|
381
|
+
// Since abandoned partitions are no longer claimed, we exclude them.
|
|
382
|
+
const partitionsToClaim = loadBalancingStrategy.getPartitionsToClaim(id, nonAbandonedPartitionOwnershipMap, partitionIds);
|
|
383
|
+
partitionsToClaim.push(...partitionsToRenew);
|
|
384
|
+
return {
|
|
385
|
+
partitionsToClaim: new Set(partitionsToClaim),
|
|
386
|
+
partitionOwnershipMap,
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
//# sourceMappingURL=eventProcessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventProcessor.js","sourceRoot":"","sources":["../../src/eventProcessor.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAqJxD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,cAAc;IAmCf;IACA;IACA;IACA;IArCF,iBAAiB,CAA4B;IAC7C,YAAY,CAAc;IAC1B,GAAG,CAAS;IACZ,UAAU,GAAY,KAAK,CAAC;IAC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AY,CACb,CAAC;IACF,iBAAiB,CAAC,IAAI,CAAC,GAAG,iBAAiB,CAAC,CAAC;IAE7C,OAAO;QACL,iBAAiB,EAAE,IAAI,GAAG,CAAC,iBAAiB,CAAC;QAC7C,qBAAqB;KACtB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport { AbortError } from \"@azure/abort-controller\";\nimport type { Checkpoint } from \"./partitionProcessor.js\";\nimport { PartitionProcessor } from \"./partitionProcessor.js\";\nimport type { EventPosition } from \"./eventPosition.js\";\nimport { isEventPosition, latestEventPosition } from \"./eventPosition.js\";\nimport type { PumpManager } from \"./pumpManager.js\";\nimport { PumpManagerImpl } from \"./pumpManager.js\";\nimport { logErrorStackTrace, logger } from \"./logger.js\";\nimport { CloseReason } from \"./models/public.js\";\nimport type { CommonEventProcessorOptions } from \"./models/private.js\";\nimport type { ConnectionContext } from \"./connectionContext.js\";\nimport type { LoadBalancingStrategy } from \"./loadBalancerStrategies/loadBalancingStrategy.js\";\nimport type { OperationOptions } from \"./util/operationOptions.js\";\nimport type { SubscriptionEventHandlers } from \"./eventHubConsumerClientModels.js\";\nimport { delayWithoutThrow } from \"./util/delayWithoutThrow.js\";\nimport { getRandomName } from \"./util/utils.js\";\nimport { StandardAbortMessage } from \"@azure/core-amqp\";\n\n/**\n * An interface representing the details on which instance of a `EventProcessor` owns processing\n * of a given partition from a consumer group of an Event Hub instance.\n *\n * **Note**: This is used internally by the `EventProcessor` and user never has to create it directly.\n */\nexport interface PartitionOwnership {\n /**\n * The fully qualified Event Hubs namespace. This is likely to be similar to\n * <yournamespace>.servicebus.windows.net\n */\n fullyQualifiedNamespace: string;\n /**\n * The event hub name\n */\n eventHubName: string;\n /**\n * The consumer group name\n */\n consumerGroup: string;\n /**\n * The identifier of the Event Hub partition.\n */\n partitionId: string;\n /**\n * The unique identifier of the event processor.\n */\n ownerId: string;\n /**\n * The last modified time.\n */\n lastModifiedTimeInMs?: number;\n /**\n * The unique identifier for the operation.\n */\n etag?: string;\n}\n\n/**\n * A checkpoint store stores and retrieves partition ownership information and checkpoint details\n * for each partition in a given consumer group of an event hub instance.\n *\n * Users are not meant to implement an `CheckpointStore`.\n * Users are expected to choose existing implementations of this interface, instantiate it, and pass\n * it to the `EventHubConsumerClient` class constructor when instantiating a client.\n * Users are not expected to use any of the methods on a checkpoint store, these are used internally by\n * the client.\n *\n * Implementations of `CheckpointStore` can be found on npm by searching for packages with the prefix @azure/eventhub-checkpointstore-.\n */\nexport interface CheckpointStore {\n /**\n * Called to get the list of all existing partition ownership from the underlying data store. Could return empty\n * results if there are is no existing ownership information.\n *\n * @param fullyQualifiedNamespace - The fully qualified Event Hubs namespace. This is likely to be similar to\n * <yournamespace>.servicebus.windows.net.\n * @param eventHubName - The event hub name.\n * @param consumerGroup - The consumer group name.\n * @param options - A set of options that can be specified to influence the behavior of this method.\n * - `abortSignal`: A signal used to request operation cancellation.\n * - `tracingOptions`: Options for configuring tracing.\n * @returns A list of partition ownership details of all the partitions that have/had an owner.\n */\n listOwnership(\n fullyQualifiedNamespace: string,\n eventHubName: string,\n consumerGroup: string,\n options?: OperationOptions,\n ): Promise<PartitionOwnership[]>;\n /**\n * Called to claim ownership of a list of partitions. This will return the list of partitions that were owned\n * successfully.\n *\n * @param partitionOwnership - The list of partition ownership this instance is claiming to own.\n * @param options - A set of options that can be specified to influence the behavior of this method.\n * - `abortSignal`: A signal used to request operation cancellation.\n * - `tracingOptions`: Options for configuring tracing.\n * @returns A list of partitions this instance successfully claimed ownership.\n */\n claimOwnership(\n partitionOwnership: PartitionOwnership[],\n options?: OperationOptions,\n ): Promise<PartitionOwnership[]>;\n\n /**\n * Updates the checkpoint in the data store for a partition.\n *\n * @param checkpoint - The checkpoint.\n * @param options - A set of options that can be specified to influence the behavior of this method.\n * - `abortSignal`: A signal used to request operation cancellation.\n * - `tracingOptions`: Options for configuring tracing.\n */\n updateCheckpoint(checkpoint: Checkpoint, options?: OperationOptions): Promise<void>;\n\n /**\n * Lists all the checkpoints in a data store for a given namespace, eventhub and consumer group.\n *\n * @param fullyQualifiedNamespace - The fully qualified Event Hubs namespace. This is likely to be similar to\n * <yournamespace>.servicebus.windows.net.\n * @param eventHubName - The event hub name.\n * @param consumerGroup - The consumer group name.\n * @param options - A set of options that can be specified to influence the behavior of this method.\n * - `abortSignal`: A signal used to request operation cancellation.\n * - `tracingOptions`: Options for configuring tracing.\n * @returns A list of checkpoints for a given namespace, eventhub, and consumer group.\n */\n listCheckpoints(\n fullyQualifiedNamespace: string,\n eventHubName: string,\n consumerGroup: string,\n options?: OperationOptions,\n ): Promise<Checkpoint[]>;\n}\n\n/**\n * A set of options to pass to the constructor of `EventProcessor`.\n * You can specify\n * - `maxBatchSize`: The max size of the batch of events passed each time to user code for processing.\n * - `maxWaitTimeInSeconds`: The maximum amount of time to wait to build up the requested message count before\n * passing the data to user code for processing. If not provided, it defaults to 60 seconds.\n *\n * Example usage with default values:\n * ```ts snippet:ignore\n * {\n * maxBatchSize: 1,\n * maxWaitTimeInSeconds: 60,\n * }\n * ```\n * @internal\n */\nexport interface FullEventProcessorOptions extends CommonEventProcessorOptions {\n /**\n * An optional pump manager to use, rather than instantiating one internally\n * @internal\n */\n pumpManager?: PumpManager;\n /**\n * The amount of time between load balancing attempts.\n */\n loopIntervalInMs: number;\n /**\n * A specific partition to target.\n */\n processingTarget?: string;\n}\n\n/**\n * Event Processor based applications consist of one or more instances of EventProcessor which have been\n * configured to consume events from the same Event Hub and consumer group. They balance the\n * workload across different instances by distributing the partitions to be processed among themselves.\n * They also allow the user to track progress when events are processed using checkpoints.\n *\n * A checkpoint is meant to represent the last successfully processed event by the user from a particular\n * partition of a consumer group in an Event Hub instance.\n *\n * @internal\n */\nexport class EventProcessor {\n private _processorOptions: FullEventProcessorOptions;\n private _pumpManager: PumpManager;\n private _id: string;\n private _isRunning: boolean = false;\n private _loopTask?: PromiseLike<void>;\n private _abortController?: AbortController;\n /**\n * A specific partition to target.\n */\n private _processingTarget?: string;\n /**\n * Determines which partitions to claim as part of load balancing.\n */\n private _loadBalancingStrategy: LoadBalancingStrategy;\n /**\n * The amount of time between load balancing attempts.\n */\n private _loopIntervalInMs: number;\n private _eventHubName: string;\n private _fullyQualifiedNamespace: string;\n\n /**\n * @param consumerGroup - The name of the consumer group from which you want to process events.\n * @param eventHubClient - An instance of `EventHubClient` that was created for the Event Hub instance.\n * @param PartitionProcessorClass - A user-provided class that extends the `PartitionProcessor` class.\n * This class will be responsible for processing and checkpointing events.\n * @param checkpointStore - An instance of `CheckpointStore`. See @azure/eventhubs-checkpointstore-blob for an implementation.\n * For production, choose an implementation that will store checkpoints and partition ownership details to a durable store.\n * @param options - A set of options to configure the Event Processor\n * - `maxBatchSize` : The max size of the batch of events passed each time to user code for processing.\n * - `maxWaitTimeInSeconds` : The maximum amount of time to wait to build up the requested message count before\n * passing the data to user code for processing. If not provided, it defaults to 60 seconds.\n */\n constructor(\n private _consumerGroup: string,\n private _context: ConnectionContext,\n private _subscriptionEventHandlers: SubscriptionEventHandlers,\n private _checkpointStore: CheckpointStore,\n options: FullEventProcessorOptions,\n ) {\n if (options.ownerId) {\n this._id = options.ownerId;\n logger.verbose(`Starting event processor with ID ${this._id}`);\n } else {\n this._id = getRandomName();\n logger.verbose(`Starting event processor with autogenerated ID ${this._id}`);\n }\n\n this._eventHubName = this._context.config.entityPath;\n this._fullyQualifiedNamespace = this._context.config.host;\n this._processorOptions = options;\n this._pumpManager =\n options.pumpManager || new PumpManagerImpl(this._id, this._processorOptions);\n this._processingTarget = options.processingTarget;\n this._loopIntervalInMs = options.loopIntervalInMs;\n this._loadBalancingStrategy = options.loadBalancingStrategy;\n }\n\n /**\n * The unique identifier for the EventProcessor.\n */\n get id(): string {\n return this._id;\n }\n\n private _createPartitionOwnershipRequest(\n partitionOwnershipMap: Map<string, PartitionOwnership>,\n partitionIdToClaim: string,\n ): PartitionOwnership {\n const previousPartitionOwnership = partitionOwnershipMap.get(partitionIdToClaim);\n const partitionOwnership: PartitionOwnership = {\n ownerId: this._id,\n partitionId: partitionIdToClaim,\n fullyQualifiedNamespace: this._fullyQualifiedNamespace,\n consumerGroup: this._consumerGroup,\n eventHubName: this._eventHubName,\n etag: previousPartitionOwnership ? previousPartitionOwnership.etag : undefined,\n };\n\n return partitionOwnership;\n }\n\n /*\n * Claim ownership of the given partition if it's available\n */\n private async _claimOwnership(\n ownershipRequest: PartitionOwnership,\n abortSignal: AbortSignalLike,\n ): Promise<void> {\n if (abortSignal.aborted) {\n logger.verbose(\n `[${this._id}] Subscription was closed before claiming ownership of ${ownershipRequest.partitionId}.`,\n );\n return;\n }\n logger.info(\n `[${this._id}] Attempting to claim ownership of partition ${ownershipRequest.partitionId}.`,\n );\n try {\n const claimedOwnerships = await this._checkpointStore.claimOwnership([ownershipRequest]);\n\n // can happen if the partition was claimed out from underneath us - we shouldn't\n // attempt to spin up a processor.\n if (!claimedOwnerships.length) {\n return;\n }\n\n logger.info(\n `[${this._id}] Successfully claimed ownership of partition ${ownershipRequest.partitionId}.`,\n );\n\n await this._startPump(ownershipRequest.partitionId, abortSignal);\n } catch (err: any) {\n logger.warning(\n `[${this._id}] Failed to claim ownership of partition ${ownershipRequest.partitionId}`,\n );\n logErrorStackTrace(err);\n await this._handleSubscriptionError(err);\n }\n }\n\n private async _startPump(partitionId: string, abortSignal: AbortSignalLike): Promise<void> {\n if (abortSignal.aborted) {\n logger.verbose(\n `[${this._id}] The subscription was closed before starting to read from ${partitionId}.`,\n );\n return;\n }\n\n if (this._pumpManager.isReceivingFromPartition(partitionId)) {\n logger.verbose(\n `[${this._id}] There is already an active partitionPump for partition \"${partitionId}\", skipping pump creation.`,\n );\n return;\n }\n\n logger.verbose(\n `[${this._id}] [${partitionId}] Calling user-provided PartitionProcessorFactory.`,\n );\n\n const partitionProcessor = new PartitionProcessor(\n this._subscriptionEventHandlers,\n this._checkpointStore,\n {\n fullyQualifiedNamespace: this._fullyQualifiedNamespace,\n eventHubName: this._eventHubName,\n consumerGroup: this._consumerGroup,\n partitionId: partitionId,\n eventProcessorId: this._id,\n },\n );\n\n const eventPosition = await this._getStartingPosition(partitionId);\n await this._pumpManager.createPump(\n eventPosition,\n this._context,\n partitionProcessor,\n abortSignal,\n );\n\n logger.verbose(`[${this._id}] PartitionPump created successfully.`);\n }\n\n private async _getStartingPosition(partitionIdToClaim: string): Promise<EventPosition> {\n const availableCheckpoints = await this._checkpointStore.listCheckpoints(\n this._fullyQualifiedNamespace,\n this._eventHubName,\n this._consumerGroup,\n );\n\n const validCheckpoints = availableCheckpoints.filter(\n (chk) => chk.partitionId === partitionIdToClaim,\n );\n\n if (validCheckpoints.length > 0) {\n return { offset: validCheckpoints[0].offset };\n }\n\n logger.verbose(\n `No checkpoint found for partition ${partitionIdToClaim}. Looking for fallback.`,\n );\n return getStartPosition(partitionIdToClaim, this._processorOptions.startPosition);\n }\n\n private async _runLoopForSinglePartition(\n partitionId: string,\n abortSignal: AbortSignalLike,\n ): Promise<void> {\n while (!abortSignal.aborted) {\n try {\n await this._startPump(partitionId, abortSignal);\n } catch (err: any) {\n logger.warning(\n `[${this._id}] An error occurred within the EventProcessor loop: ${err?.name}: ${err?.message}`,\n );\n logErrorStackTrace(err);\n await this._handleSubscriptionError(err);\n } finally {\n // sleep for some time after which we can attempt to create a pump again.\n logger.verbose(\n `[${this._id}] Pausing the EventProcessor loop for ${this._loopIntervalInMs} ms.`,\n );\n // swallow errors from delay since it's fine for delay to exit early\n await delayWithoutThrow(this._loopIntervalInMs, abortSignal);\n }\n }\n this._isRunning = false;\n }\n\n /**\n * Every loop to this method will result in this EventProcessor owning at most one new partition.\n *\n * The load is considered balanced when no active EventProcessor owns 2 partitions more than any other active\n * EventProcessor. Given that each invocation to this method results in ownership claim of at most one partition,\n * this algorithm converges gradually towards a steady state.\n *\n * When a new partition is claimed, this method is also responsible for starting a partition pump that creates an\n * EventHubConsumer for processing events from that partition.\n */\n private async _runLoopWithLoadBalancing(\n loadBalancingStrategy: LoadBalancingStrategy,\n abortSignal: AbortSignalLike,\n ): Promise<void> {\n let cancelLoopResolver;\n // This provides a mechanism for exiting the loop early\n // if the subscription has had `close` called.\n const cancelLoopPromise = new Promise<void>((resolve) => {\n cancelLoopResolver = resolve;\n if (abortSignal.aborted) {\n resolve();\n return;\n }\n\n abortSignal.addEventListener(\"abort\", resolve);\n });\n\n // Periodically check if any partitions need to be claimed and claim them.\n while (!abortSignal.aborted) {\n const iterationStartTimeInMs = Date.now();\n try {\n const { partitionIds } = await this._context.managementSession!.getEventHubProperties({\n abortSignal,\n });\n await this._performLoadBalancing(loadBalancingStrategy, partitionIds, abortSignal);\n } catch (err: any) {\n logger.warning(\n `[${this._id}] An error occurred within the EventProcessor loop: ${err?.name}: ${err?.message}`,\n );\n logErrorStackTrace(err);\n // Protect against the scenario where the user awaits on subscription.close() from inside processError.\n await Promise.race([this._handleSubscriptionError(err), cancelLoopPromise]);\n } finally {\n // Sleep for some time, then continue the loop.\n const iterationDeltaInMs = Date.now() - iterationStartTimeInMs;\n const delayDurationInMs = Math.max(this._loopIntervalInMs - iterationDeltaInMs, 0);\n logger.verbose(\n `[${this._id}] Pausing the EventProcessor loop for ${delayDurationInMs} ms.`,\n );\n // Swallow the error since it's fine to exit early from the delay.\n await delayWithoutThrow(delayDurationInMs, abortSignal);\n }\n }\n\n if (cancelLoopResolver) {\n abortSignal.removeEventListener(\"abort\", cancelLoopResolver);\n }\n this._isRunning = false;\n }\n\n private async _performLoadBalancing(\n loadBalancingStrategy: LoadBalancingStrategy,\n partitionIds: string[],\n abortSignal: AbortSignalLike,\n ): Promise<void> {\n if (abortSignal.aborted) throw new AbortError(StandardAbortMessage);\n\n // Retrieve current partition ownership details from the datastore.\n const partitionOwnership = await this._checkpointStore.listOwnership(\n this._fullyQualifiedNamespace,\n this._eventHubName,\n this._consumerGroup,\n );\n\n if (abortSignal.aborted) throw new AbortError(StandardAbortMessage);\n\n const { partitionOwnershipMap, partitionsToClaim } = computePartitionsToClaim({\n id: this._id,\n isReceivingFromPartition: (partitionId: string) =>\n this._pumpManager.isReceivingFromPartition(partitionId),\n loadBalancingStrategy,\n partitionIds,\n partitionOwnership,\n });\n\n for (const partitionToClaim of partitionsToClaim) {\n const partitionOwnershipRequest = this._createPartitionOwnershipRequest(\n partitionOwnershipMap,\n partitionToClaim,\n );\n\n await this._claimOwnership(partitionOwnershipRequest, abortSignal);\n }\n }\n\n /**\n * This is called when there are errors that are not specific to a partition (ex: load balancing)\n */\n private async _handleSubscriptionError(err: Error): Promise<void> {\n // filter out any internal \"expected\" errors\n if (err.name === \"AbortError\") {\n return;\n }\n\n if (this._subscriptionEventHandlers.processError) {\n try {\n await this._subscriptionEventHandlers.processError(err, {\n fullyQualifiedNamespace: this._fullyQualifiedNamespace,\n eventHubName: this._eventHubName,\n consumerGroup: this._consumerGroup,\n partitionId: \"\",\n updateCheckpoint: async () => {\n /* no-op */\n },\n });\n } catch (errorFromUser: any) {\n logger.verbose(\n `[${this._id}] An error was thrown from the user's processError handler: ${errorFromUser}`,\n );\n }\n }\n }\n\n /**\n * Starts the `EventProcessor`. Based on the number of instances of `EventProcessor` that are running for the\n * same consumer group, the partitions are distributed among these instances to process events.\n *\n * For each partition, the user provided `PartitionProcessor` is instantiated.\n *\n * Subsequent calls to start will be ignored if this event processor is already running.\n * Calling `start()` after `stop()` is called will restart this event processor.\n *\n */\n start(): void {\n if (this._isRunning) {\n logger.verbose(`[${this._id}] Attempted to start an already running EventProcessor.`);\n return;\n }\n\n this._isRunning = true;\n this._abortController = new AbortController();\n logger.verbose(`[${this._id}] Starting an EventProcessor.`);\n\n if (this._processingTarget) {\n logger.verbose(`[${this._id}] Single partition target: ${this._processingTarget}`);\n this._loopTask = this._runLoopForSinglePartition(\n this._processingTarget,\n this._abortController.signal,\n );\n } else {\n logger.verbose(`[${this._id}] Multiple partitions, using load balancer`);\n this._loopTask = this._runLoopWithLoadBalancing(\n this._loadBalancingStrategy,\n this._abortController.signal,\n );\n }\n }\n\n isRunning(): boolean {\n return this._isRunning;\n }\n\n /**\n * Stops processing events for all partitions owned by this event processor.\n * All `PartitionProcessor` will be shutdown and any open resources will be closed.\n *\n * Subsequent calls to stop will be ignored if the event processor is not running.\n *\n */\n async stop(): Promise<void> {\n logger.verbose(`[${this._id}] Stopping an EventProcessor.`);\n // cancel the event processor loop\n this._abortController?.abort();\n\n try {\n // remove all existing pumps\n await this._pumpManager.removeAllPumps(CloseReason.Shutdown);\n\n // waits for the event processor loop to complete\n // will complete immediately if _loopTask is undefined\n if (this._loopTask) {\n await this._loopTask;\n }\n } catch (err: any) {\n logger.verbose(`[${this._id}] An error occurred while stopping the EventProcessor: ${err}`);\n } finally {\n logger.verbose(`[${this._id}] EventProcessor stopped.`);\n }\n\n if (this._processingTarget) {\n logger.verbose(`[${this._id}] No partitions owned, skipping abandoning.`);\n } else {\n await this.abandonPartitionOwnerships();\n }\n }\n\n private async abandonPartitionOwnerships(): Promise<PartitionOwnership[]> {\n logger.verbose(`[${this._id}] Abandoning owned partitions`);\n const allOwnerships = await this._checkpointStore.listOwnership(\n this._fullyQualifiedNamespace,\n this._eventHubName,\n this._consumerGroup,\n );\n const ourOwnerships = allOwnerships.filter((ownership) => ownership.ownerId === this._id);\n // unclaim any partitions that we currently own\n for (const ownership of ourOwnerships) {\n ownership.ownerId = \"\";\n }\n return this._checkpointStore.claimOwnership(ourOwnerships);\n }\n}\n\nfunction isAbandoned(ownership: PartitionOwnership): boolean {\n return ownership.ownerId === \"\";\n}\n\nfunction getStartPosition(\n partitionIdToClaim: string,\n startPositions?: EventPosition | { [partitionId: string]: EventPosition },\n): EventPosition {\n if (startPositions == null) {\n return latestEventPosition;\n }\n\n if (isEventPosition(startPositions)) {\n return startPositions;\n }\n\n const startPosition = (startPositions as { [partitionId: string]: EventPosition })[\n partitionIdToClaim\n ];\n\n if (startPosition == null) {\n return latestEventPosition;\n }\n\n return startPosition;\n}\n\nfunction computePartitionsToClaim(inputs: {\n partitionOwnership: PartitionOwnership[];\n id: string;\n isReceivingFromPartition: (id: string) => boolean;\n loadBalancingStrategy: LoadBalancingStrategy;\n partitionIds: string[];\n}): {\n partitionsToClaim: Set<string>;\n partitionOwnershipMap: Map<string, PartitionOwnership>;\n} {\n const { partitionOwnership, id, isReceivingFromPartition, loadBalancingStrategy, partitionIds } =\n inputs;\n\n const partitionOwnershipMap = new Map<string, PartitionOwnership>();\n const nonAbandonedPartitionOwnershipMap = new Map<string, PartitionOwnership>();\n const partitionsToRenew: string[] = [];\n\n // Separate abandoned ownerships from claimed ownerships.\n // We only want to pass active partition ownerships to the\n // load balancer, but we need to hold onto the abandoned\n // partition ownerships because we need the etag to claim them.\n for (const ownership of partitionOwnership) {\n partitionOwnershipMap.set(ownership.partitionId, ownership);\n if (!isAbandoned(ownership)) {\n nonAbandonedPartitionOwnershipMap.set(ownership.partitionId, ownership);\n }\n if (ownership.ownerId === id && isReceivingFromPartition(ownership.partitionId)) {\n partitionsToRenew.push(ownership.partitionId);\n }\n }\n\n // Pass the list of all the partition ids and the collection of claimed partition ownerships\n // to the load balance strategy.\n // The load balancing strategy only needs to know the full list of partitions,\n // and which of those are currently claimed.\n // Since abandoned partitions are no longer claimed, we exclude them.\n const partitionsToClaim = loadBalancingStrategy.getPartitionsToClaim(\n id,\n nonAbandonedPartitionOwnershipMap,\n partitionIds,\n );\n partitionsToClaim.push(...partitionsToRenew);\n\n return {\n partitionsToClaim: new Set(partitionsToClaim),\n partitionOwnershipMap,\n };\n}\n"]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ConnectionConfig } from "@azure/core-amqp";
|
|
2
|
+
/**
|
|
3
|
+
* Describes the connection config object that is created after parsing an EventHub connection
|
|
4
|
+
* string. It also provides some convenience methods for getting the address and audience for
|
|
5
|
+
* different entities.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export interface EventHubConnectionConfig extends ConnectionConfig {
|
|
9
|
+
/**
|
|
10
|
+
* The name/path of the entity (event hub name) to which the
|
|
11
|
+
* connection needs to happen.
|
|
12
|
+
*/
|
|
13
|
+
entityPath: string;
|
|
14
|
+
/**
|
|
15
|
+
* Provides the EventHub Sender address in one of the following forms based on the input:
|
|
16
|
+
* - `"<hubName>"`
|
|
17
|
+
* - `"<hubName>/Partitions/<partitionId>"`
|
|
18
|
+
*
|
|
19
|
+
* @param partitionId - The partitionId in the EventHub to which messages will be sent.
|
|
20
|
+
*/
|
|
21
|
+
getSenderAddress(partitionId?: string | number): string;
|
|
22
|
+
/**
|
|
23
|
+
* Provides the EventHub Sender audience in one of the following forms based on the input:
|
|
24
|
+
* - `"sb://<yournamespace>.servicebus.windows.net/<hubName>"`
|
|
25
|
+
* - `"sb://<yournamespace>.servicebus.windows.net/<hubName>/Partitions/<partitionId>"`
|
|
26
|
+
*
|
|
27
|
+
* @param partitionId - The partitionId in the EventHub to which messages will be sent.
|
|
28
|
+
*/
|
|
29
|
+
getSenderAudience(partitionId?: string | number): string;
|
|
30
|
+
/**
|
|
31
|
+
* Provides the EventHub Receiver address:
|
|
32
|
+
* - `"<hub-name>/ConsumerGroups/<consumer-group-name>/Partitions/<partition-id>"`
|
|
33
|
+
*
|
|
34
|
+
* @param partitionId - The partitionId in the EventHub from which messages will be received.
|
|
35
|
+
* @param consumergroup - The consumergroup in the EventHub from which the messages will
|
|
36
|
+
* be received. Default: `$default`.
|
|
37
|
+
*/
|
|
38
|
+
getReceiverAddress(partitionId: string | number, consumergroup?: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Provides the EventHub Receiver audience.
|
|
41
|
+
* - `"sb://<your-namespace>.servicebus.windows.net/<hub-name>/ConsumerGroups/<consumer-group-name>/Partitions/<partition-id>"`
|
|
42
|
+
*
|
|
43
|
+
* @param partitionId - The partitionId in the EventHub from which messages will be received.
|
|
44
|
+
* @param consumergroup - The consumergroup in the EventHub from which the messages will
|
|
45
|
+
* be received. Default: `$default`.
|
|
46
|
+
*/
|
|
47
|
+
getReceiverAudience(partitionId: string | number, consumergroup?: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* Provides the EventHub Management address.
|
|
50
|
+
* - `"<hub-name>/$management"`
|
|
51
|
+
*/
|
|
52
|
+
getManagementAddress(): string;
|
|
53
|
+
/**
|
|
54
|
+
* Provides the EventHub Management audience.
|
|
55
|
+
* - `"sb://<your-namespace>.servicebus.windows.net/<hub-name>/$management"`
|
|
56
|
+
*/
|
|
57
|
+
getManagementAudience(): string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Describes the connection config object that is created after parsing an EventHub connection
|
|
61
|
+
* string. It also provides some convenience methods for getting the address and audience for
|
|
62
|
+
* different entities.
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
export declare const EventHubConnectionConfig: {
|
|
66
|
+
/**
|
|
67
|
+
* Creates the connection config.
|
|
68
|
+
* @param connectionString - The connection string for a given service like
|
|
69
|
+
* EventHub/ServiceBus.
|
|
70
|
+
* @param path - The name/path of the entity (hub name) to which the
|
|
71
|
+
* connection needs to happen. This will override the EntityPath in the connectionString
|
|
72
|
+
* if present.
|
|
73
|
+
* @returns EventHubConnectionConfig
|
|
74
|
+
*/
|
|
75
|
+
create(connectionString: string, path?: string): EventHubConnectionConfig;
|
|
76
|
+
/**
|
|
77
|
+
* Creates an EventHubConnectionConfig from the provided base ConnectionConfig.
|
|
78
|
+
* @param config - The base connection config from which the EventHubConnectionConfig needs to be
|
|
79
|
+
* created.
|
|
80
|
+
* @returns EventHubConnectionConfig
|
|
81
|
+
*/
|
|
82
|
+
createFromConnectionConfig(config: ConnectionConfig): EventHubConnectionConfig;
|
|
83
|
+
/**
|
|
84
|
+
* Updates the provided EventHubConnectionConfig to use the custom endpoint address.
|
|
85
|
+
* @param config - An existing connection configuration to be updated.
|
|
86
|
+
* @param customEndpointAddress - The custom endpoint address to use.
|
|
87
|
+
*/
|
|
88
|
+
setCustomEndpointAddress(config: EventHubConnectionConfig, customEndpointAddress: string): void;
|
|
89
|
+
/**
|
|
90
|
+
* Validates the properties of connection config.
|
|
91
|
+
* @param config - The connection config to be validated.
|
|
92
|
+
* @returns void
|
|
93
|
+
*/
|
|
94
|
+
validate(config: EventHubConnectionConfig): void;
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=eventhubConnectionConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventhubConnectionConfig.d.ts","sourceRoot":"","sources":["../../src/eventhubConnectionConfig.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGpD;;;;;GAKG;AACH,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAChE;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACxD;;;;;;OAMG;IACH,iBAAiB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACzD;;;;;;;OAOG;IACH,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjF;;;;;;;OAOG;IACH,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAClF;;;OAGG;IACH,oBAAoB,IAAI,MAAM,CAAC;IAC/B;;;OAGG;IACH,qBAAqB,IAAI,MAAM,CAAC;CACjC;AAED;;;;;GAKG;AAEH,eAAO,MAAM,wBAAwB;IACnC;;;;;;;;OAQG;6BACsB,MAAM,SAAS,MAAM,GAAG,wBAAwB;IAWzE;;;;;OAKG;uCACgC,gBAAgB,GAAG,wBAAwB;IA+C9E;;;;OAIG;qCAC8B,wBAAwB,yBAAyB,MAAM,GAAG,IAAI;IAW/F;;;;OAIG;qBACc,wBAAwB,GAAG,IAAI;CAGjD,CAAC"}
|