3
3
4
4
import * as uuid from "uuid/v4" ;
5
5
import {
6
- EventHubClient , EventPosition , TokenProvider , DefaultDataTransformer ,
7
- EventHubRuntimeInformation , EventHubPartitionRuntimeInformation , ConnectionConfig
6
+ EventHubClient , EventPosition , TokenProvider , DefaultDataTransformer , Dictionary ,
7
+ EventHubRuntimeInformation , EventHubPartitionRuntimeInformation , EventHubConnectionConfig
8
8
} from "@azure/event-hubs" ;
9
- import { Constants , Dictionary , getNewAsyncLock , AsyncLock } from "@azure/amqp-common " ;
9
+ import * as AsyncLock from "async-lock " ;
10
10
import { LeaseManager } from "./leaseManager" ;
11
11
import { PumpManager } from "./pumpManager" ;
12
12
import { PartitionManager } from "./partitionManager" ;
@@ -25,7 +25,7 @@ import {
25
25
import {
26
26
maxLeaseDurationInSeconds , minLeaseDurationInSeconds , defaultLeaseRenewIntervalInSeconds ,
27
27
defaultLeaseDurationInSeconds , defaultStartupScanDelayInSeconds , packageInfo , userAgentPrefix ,
28
- defaultFastScanIntervalInSeconds , defaultSlowScanIntervalInSeconds
28
+ defaultFastScanIntervalInSeconds , defaultSlowScanIntervalInSeconds , defaultConsumerGroup
29
29
} from "./util/constants" ;
30
30
31
31
/**
@@ -39,7 +39,7 @@ export interface BaseHostContext {
39
39
eventHubPath : string ;
40
40
storageContainerName ?: string ;
41
41
eventHubConnectionString : string ;
42
- connectionConfig : ConnectionConfig ;
42
+ connectionConfig : EventHubConnectionConfig ;
43
43
onEphError : OnEphError ;
44
44
leaseRenewInterval : number ;
45
45
leaseDuration : number ;
@@ -148,10 +148,10 @@ export namespace HostContext {
148
148
const onEphErrorFunc : OnEphError = ( ) => {
149
149
// do nothing
150
150
} ;
151
- const config = ConnectionConfig . create ( options . eventHubConnectionString ! , options . eventHubPath ) ;
151
+ const config = EventHubConnectionConfig . create ( options . eventHubConnectionString ! , options . eventHubPath ) ;
152
152
153
153
// set defaults
154
- if ( ! options . consumerGroup ) options . consumerGroup = Constants . defaultConsumerGroup ;
154
+ if ( ! options . consumerGroup ) options . consumerGroup = defaultConsumerGroup ;
155
155
if ( ! options . eventHubPath ) options . eventHubPath = config . entityPath ;
156
156
if ( ! options . leaseRenewInterval ) options . leaseRenewInterval = defaultLeaseRenewIntervalInSeconds ;
157
157
if ( ! options . leaseDuration ) options . leaseDuration = defaultLeaseDurationInSeconds ;
@@ -178,7 +178,7 @@ export namespace HostContext {
178
178
179
179
const context : BaseHostContext = {
180
180
hostName : hostName ,
181
- checkpointLock : getNewAsyncLock ( { maxPending : 100000 } ) ,
181
+ checkpointLock : new AsyncLock ( { maxPending : 100000 } ) ,
182
182
checkpointLockId : `checkpoint-${ uuid ( ) } ` ,
183
183
eventHubConnectionString : options . eventHubConnectionString ! ,
184
184
connectionConfig : config ,
0 commit comments