Closes the underlying AMQP sender link.
Once closed, the producer cannot be used for any further operations.
Use the createProducer
function on the EventHubClient to instantiate a new EventHubProducer.
Creates an instance of EventDataBatch
to which one can add events until the maximum supported size is reached.
The batch can be passed to the send()
method of the EventHubProducer
to be sent to Azure Event Hubs.
A set of options to configure the behavior of the batch.
partitionKey
: A value that is hashed to produce a partition assignment.
Not applicable if the EventHubProducer
was created using a partitionId
.maxSizeInBytes
: The upper limit for the size of batch. The tryAdd
function will return false
after this limit is reached.abortSignal
: A signal the request to cancel the send operation.Promise
Send one or more of events to the associated Event Hub.
An individual EventData
object, or an array of EventData
objects or an
instance of EventDataBatch
.
The set of options that can be specified to influence the way in which events are sent to the associated Event Hub.
partitionKey
: A value that is hashed to produce a partition assignment.
Not applicable if the EventHubProducer
was created using a partitionId
.abortSignal
: A signal the request to cancel the send operation.Promise
Generated using TypeDoc
A producer responsible for sending events to an Event Hub. To create a producer use the
createProducer()
method on yourEventHubClient
. You can pass the below in theoptions
when creating a producer.partitionId
: The identifier of the partition that the producer can be bound to.retryOptions
: The retry options used to govern retry attempts when an issue is encountered while sending events. A simple usage can be{ "maxRetries": 4 }
.If
partitionId
is specified when creating a producer, all event data sent using the producer will be sent to the specified partition. Otherwise, they are automatically routed to an available partition by the Event Hubs service.Automatic routing of partitions is recommended because: