33
44import * as uuid from "uuid/v4" ;
55import {
6- EventHubClient , EventPosition , TokenProvider , DefaultDataTransformer ,
7- EventHubRuntimeInformation , EventHubPartitionRuntimeInformation , ConnectionConfig
6+ EventHubClient , EventPosition , TokenProvider , DefaultDataTransformer , Dictionary ,
7+ EventHubRuntimeInformation , EventHubPartitionRuntimeInformation , EventHubConnectionConfig
88} from "@azure/event-hubs" ;
9- import { Constants , Dictionary , getNewAsyncLock , AsyncLock } from "@azure/amqp-common " ;
9+ import * as AsyncLock from "async-lock " ;
1010import { LeaseManager } from "./leaseManager" ;
1111import { PumpManager } from "./pumpManager" ;
1212import { PartitionManager } from "./partitionManager" ;
@@ -25,7 +25,7 @@ import {
2525import {
2626 maxLeaseDurationInSeconds , minLeaseDurationInSeconds , defaultLeaseRenewIntervalInSeconds ,
2727 defaultLeaseDurationInSeconds , defaultStartupScanDelayInSeconds , packageInfo , userAgentPrefix ,
28- defaultFastScanIntervalInSeconds , defaultSlowScanIntervalInSeconds
28+ defaultFastScanIntervalInSeconds , defaultSlowScanIntervalInSeconds , defaultConsumerGroup
2929} from "./util/constants" ;
3030
3131/**
@@ -39,7 +39,7 @@ export interface BaseHostContext {
3939 eventHubPath : string ;
4040 storageContainerName ?: string ;
4141 eventHubConnectionString : string ;
42- connectionConfig : ConnectionConfig ;
42+ connectionConfig : EventHubConnectionConfig ;
4343 onEphError : OnEphError ;
4444 leaseRenewInterval : number ;
4545 leaseDuration : number ;
@@ -148,10 +148,10 @@ export namespace HostContext {
148148 const onEphErrorFunc : OnEphError = ( ) => {
149149 // do nothing
150150 } ;
151- const config = ConnectionConfig . create ( options . eventHubConnectionString ! , options . eventHubPath ) ;
151+ const config = EventHubConnectionConfig . create ( options . eventHubConnectionString ! , options . eventHubPath ) ;
152152
153153 // set defaults
154- if ( ! options . consumerGroup ) options . consumerGroup = Constants . defaultConsumerGroup ;
154+ if ( ! options . consumerGroup ) options . consumerGroup = defaultConsumerGroup ;
155155 if ( ! options . eventHubPath ) options . eventHubPath = config . entityPath ;
156156 if ( ! options . leaseRenewInterval ) options . leaseRenewInterval = defaultLeaseRenewIntervalInSeconds ;
157157 if ( ! options . leaseDuration ) options . leaseDuration = defaultLeaseDurationInSeconds ;
@@ -178,7 +178,7 @@ export namespace HostContext {
178178
179179 const context : BaseHostContext = {
180180 hostName : hostName ,
181- checkpointLock : getNewAsyncLock ( { maxPending : 100000 } ) ,
181+ checkpointLock : new AsyncLock ( { maxPending : 100000 } ) ,
182182 checkpointLockId : `checkpoint-${ uuid ( ) } ` ,
183183 eventHubConnectionString : options . eventHubConnectionString ! ,
184184 connectionConfig : config ,
0 commit comments