How to use the @azure/event-hubs.EventPosition.startOfStream function in @azure/event-hubs

To help you get started, we’ve selected a few @azure/event-hubs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-sdk-for-js / sdk / eventhub / event-processor-host / src / partitionContext.ts View on Github external
* @property {string} eventhubPath The path of the eventhub
   * @readonly
   */
  get eventhubPath(): string {
    return this._context.eventHubPath;
  }
  /**
   * @property {string} consumerGroup The name of the consumer group.
   * @readonly
   */
  get consumerGroup(): string {
    return this._context.consumerGroup;
  }

  private _context: HostContextWithCheckpointLeaseManager;
  private _offset: string = EventPosition.startOfStream;
  private _sequenceNumber: number = 0;

  /**
   * Creates a new PartitionContext.
   * @param {string} partitionId The eventhub partition id.
   * @param {string} owner The name of the owner.
   * @param {CompleteLease} lease The lease object.
   */
  constructor(
    context: HostContextWithCheckpointLeaseManager,
    partitionId: string,
    lease: CompleteLease
  ) {
    this._context = context;
    this.partitionId = partitionId;
    this.lease = lease;