EventPosition interface

Represents the position of an event in an Event Hub partition, typically used when calling the subscribe() method on an EventHubConsumerClient to specify the position in the partition to begin receiving events from.

To get an EventPosition representing the start or end of the stream, use the constants earliestEventPosition and latestEventPosition respectively.

Properties

enqueuedOn

The enqueued time in UTC of the event identified by this position. When provided as a number this value is the number of milliseconds since the Unix Epoch. Expected to be undefined if the position is just created from a sequence number or an offset.

isInclusive

Indicates if the specified offset is inclusive of the event which it identifies. This information is only relevent if the event position was identified by an offset or sequence number. Default value: false.

offset

The offset of the event identified by this position. Expected to be undefined if the position is just created from a sequence number or an enqueued time.

The offset is the relative position for an event in the context of the partition. The offset should not be considered a stable value. The same offset may refer to a different event as events reach the age limit for retention and are no longer visible within the partition.

sequenceNumber

The sequence number of the event identified by this position. Expected to be undefined if the position is just created from an offset or enqueued time.

Property Details

enqueuedOn

The enqueued time in UTC of the event identified by this position. When provided as a number this value is the number of milliseconds since the Unix Epoch. Expected to be undefined if the position is just created from a sequence number or an offset.

enqueuedOn?: number | Date

Property Value

number | Date

isInclusive

Indicates if the specified offset is inclusive of the event which it identifies. This information is only relevent if the event position was identified by an offset or sequence number. Default value: false.

isInclusive?: boolean

Property Value

boolean

offset

The offset of the event identified by this position. Expected to be undefined if the position is just created from a sequence number or an enqueued time.

The offset is the relative position for an event in the context of the partition. The offset should not be considered a stable value. The same offset may refer to a different event as events reach the age limit for retention and are no longer visible within the partition.

offset?: number | "@latest"

Property Value

number | "@latest"

sequenceNumber

The sequence number of the event identified by this position. Expected to be undefined if the position is just created from an offset or enqueued time.

sequenceNumber?: number

Property Value

number