Bagikan melalui


EventHubConnection Class

Definition

A connection to the Azure Event Hubs service, enabling client communications with a specific Event Hub instance within an Event Hubs namespace. A single connection may be shared among multiple Event Hub producers and/or consumers, or may be used as a dedicated connection for a single producer or consumer client.

public class EventHubConnection : IAsyncDisposable
type EventHubConnection = class
    interface IAsyncDisposable
Public Class EventHubConnection
Implements IAsyncDisposable
Inheritance
EventHubConnection
Implements

Constructors

EventHubConnection()

Initializes a new instance of the EventHubConnection class.

EventHubConnection(String, EventHubConnectionOptions)

Initializes a new instance of the EventHubConnection class.

EventHubConnection(String, String, AzureNamedKeyCredential, EventHubConnectionOptions)

Initializes a new instance of the EventHubConnection class.

EventHubConnection(String, String, AzureSasCredential, EventHubConnectionOptions)

Initializes a new instance of the EventHubConnection class.

EventHubConnection(String, String, EventHubConnectionOptions)

Initializes a new instance of the EventHubConnection class.

EventHubConnection(String, String, TokenCredential, EventHubConnectionOptions)

Initializes a new instance of the EventHubConnection class.

EventHubConnection(String, String)

Initializes a new instance of the EventHubConnection class.

EventHubConnection(String)

Initializes a new instance of the EventHubConnection class.

Properties

EventHubName

The name of the Event Hub that the connection is associated with, specific to the Event Hubs namespace that contains it.

FullyQualifiedNamespace

The fully qualified Event Hubs namespace that the connection is associated with. This is likely to be similar to {yournamespace}.servicebus.windows.net.

IsClosed

Indicates whether or not this EventHubConnection has been closed.

Methods

CloseAsync(CancellationToken)

Closes the connection to the Event Hubs namespace and associated Event Hub.

DisposeAsync()

Performs the task needed to clean up resources used by the EventHubConnection, including ensuring that the connection itself has been closed.

Applies to