Share via


EventHubBufferedProducerClient.EnqueueEventAsync Method

Definition

Overloads

EnqueueEventAsync(EventData, CancellationToken)

Enqueues an EventData into the buffer to be published to the Event Hub. If there is no capacity in the buffer when this method is invoked, it will wait for space to become available and ensure that the eventData has been enqueued.

When this call returns, the eventData has been accepted into the buffer, but it may not have been published yet. Publishing will take place at a nondeterministic point in the future as the buffer is processed.

EnqueueEventAsync(EventData, EnqueueEventOptions, CancellationToken)

Enqueues an EventData into the buffer to be published to the Event Hub. If there is no capacity in the buffer when this method is invoked, it will wait for space to become available and ensure that the eventData has been enqueued.

When this call returns, the eventData has been accepted into the buffer, but it may not have been published yet. Publishing will take place at a nondeterministic point in the future as the buffer is processed.

EnqueueEventAsync(EventData, CancellationToken)

Source:
EventHubBufferedProducerClient.cs
Source:
EventHubBufferedProducerClient.cs

Enqueues an EventData into the buffer to be published to the Event Hub. If there is no capacity in the buffer when this method is invoked, it will wait for space to become available and ensure that the eventData has been enqueued.

When this call returns, the eventData has been accepted into the buffer, but it may not have been published yet. Publishing will take place at a nondeterministic point in the future as the buffer is processed.

public virtual System.Threading.Tasks.Task<int> EnqueueEventAsync (Azure.Messaging.EventHubs.EventData eventData, System.Threading.CancellationToken cancellationToken = default);
abstract member EnqueueEventAsync : Azure.Messaging.EventHubs.EventData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<int>
override this.EnqueueEventAsync : Azure.Messaging.EventHubs.EventData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<int>
Public Overridable Function EnqueueEventAsync (eventData As EventData, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Integer)

Parameters

eventData
EventData

The event to be enqueued into the buffer and, later, published.

cancellationToken
CancellationToken

An optional CancellationToken instance to signal the request to cancel the operation.

Returns

The total number of events that are currently buffered and waiting to be published, across all partitions.

Exceptions

Occurs when no SendEventBatchFailedAsync handler is currently registered.

Occurs when querying Event Hub metadata took longer than expected.

Remarks

Upon the first attempt to enqueue an event, the SendEventBatchSucceededAsync and SendEventBatchFailedAsync handlers can no longer be changed.

Applies to

EnqueueEventAsync(EventData, EnqueueEventOptions, CancellationToken)

Source:
EventHubBufferedProducerClient.cs
Source:
EventHubBufferedProducerClient.cs

Enqueues an EventData into the buffer to be published to the Event Hub. If there is no capacity in the buffer when this method is invoked, it will wait for space to become available and ensure that the eventData has been enqueued.

When this call returns, the eventData has been accepted into the buffer, but it may not have been published yet. Publishing will take place at a nondeterministic point in the future as the buffer is processed.

public virtual System.Threading.Tasks.Task<int> EnqueueEventAsync (Azure.Messaging.EventHubs.EventData eventData, Azure.Messaging.EventHubs.Producer.EnqueueEventOptions options, System.Threading.CancellationToken cancellationToken = default);
abstract member EnqueueEventAsync : Azure.Messaging.EventHubs.EventData * Azure.Messaging.EventHubs.Producer.EnqueueEventOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<int>
override this.EnqueueEventAsync : Azure.Messaging.EventHubs.EventData * Azure.Messaging.EventHubs.Producer.EnqueueEventOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<int>
Public Overridable Function EnqueueEventAsync (eventData As EventData, options As EnqueueEventOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Integer)

Parameters

eventData
EventData

The event to be enqueued into the buffer and, later, published.

options
EnqueueEventOptions

The set of options to apply when publishing this event.

cancellationToken
CancellationToken

An optional CancellationToken instance to signal the request to cancel the operation.

Returns

The total number of events that are currently buffered and waiting to be published, across all partitions.

Exceptions

Occurs when an invalid partition identifier has been specified in the options.

Occurs when querying Event Hub metadata took longer than expected.

Remarks

Upon the first attempt to enqueue an event, the SendEventBatchSucceededAsync and SendEventBatchFailedAsync handlers can no longer be changed.

Applies to