How to use the @azure/event-hubs.EventHubClient.createFromTokenProvider 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 / hostContext.ts View on Github external
ctxt.getEventHubClient = () => {
      if (ctxt.tokenProvider) {
        return EventHubClient.createFromTokenProvider(
          ctxt.connectionConfig.host,
          ctxt.eventHubPath,
          ctxt.tokenProvider,
          { userAgent: ctxt.userAgent }
        );
      } else {
        return EventHubClient.createFromConnectionString(ctxt.eventHubConnectionString, ctxt.eventHubPath, {
          userAgent: ctxt.userAgent
        });
      }
    };
    ctxt.getHubRuntimeInformation = async () => {