The connection string to use for connecting to the Event Hubs namespace. It is expected that the shared key properties and the Event Hub path are contained in this connection string. e.g. 'Endpoint=sb://my-servicebus-namespace.servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key;EntityPath=my-event-hub-name'.
A set of options to apply when configuring the client.
dataTransformer
: A set of encode
/decode
methods to be used to encode an event before sending to service
and to decode the event received from the serviceuserAgent
: A string to append to the built in user agent string that is passed as a connection property
to the service.websocket
: The WebSocket constructor used to create an AMQP connection if you choose to make the connection
over a WebSocket.webSocketConstructorOptions
: Options to pass to the Websocket constructor when you choose to make the connection
over a WebSocket.retryOptions
: The retry options for all the operations on the client/producer/consumer.
A simple usage can be { "maxRetries": 4 }
.The connection string to use for connecting to the Event Hubs namespace. It is expected that the shared key properties and the Event Hub path are contained in this connection string. e.g. 'Endpoint=sb://my-servicebus-namespace.servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key;EntityPath=my-event-hub-name'.
The path of the specific Event Hub to connect the client to.
A set of options to apply when configuring the client.
dataTransformer
: A set of encode
/decode
methods to be used to encode an event before sending to service
and to decode the event received from the serviceuserAgent
: A string to append to the built in user agent string that is passed as a connection property
to the service.websocket
: The WebSocket constructor used to create an AMQP connection if you choose to make the connection
over a WebSocket.webSocketConstructorOptions
: Options to pass to the Websocket constructor when you choose to make the connection
over a WebSocket.retryOptions
: The retry options for all the operations on the client/producer/consumer.
A simple usage can be { "maxRetries": 4 }
.The fully qualified host name for the Event Hubs namespace. This is likely to be similar to
The path of the specific Event Hub to connect the client to.
SharedKeyCredential object or your credential that implements the TokenCredential interface.
A set of options to apply when configuring the client.
dataTransformer
: A set of encode
/decode
methods to be used to encode an event before sending to service
and to decode the event received from the serviceuserAgent
: A string to append to the built in user agent string that is passed as a connection property
to the service.websocket
: The WebSocket constructor used to create an AMQP connection if you choose to make the connection
over a WebSocket.webSocketConstructorOptions
: Options to pass to the Websocket constructor when you choose to make the connection
over a WebSocket.retryOptions
: The retry options for all the operations on the client/producer/consumer.
A simple usage can be { "maxRetries": 4 }
.Closes the AMQP connection to the Event Hub instance, returning a promise that will be resolved when disconnection is completed.
Promise
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 sendBatch method of the EventHubProducerClient
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 operation.Promise
Provides an array of partitionIds.
A promise that resolves with an Array of strings.
Provides the Event Hub runtime information.
A promise that resolves with EventHubProperties.
Sends a batch of events to the associated Event Hub.
An instance of EventDataBatch
that you can create using the createBatch method.
The set of options that can be specified to influence the way in which events are sent to the associated Event Hub.
abortSignal
: A signal the request to cancel the send operation.Promise
Sends a batch of events to the associated Event Hub to a specific partition
An instance of EventDataBatch
that you can create using the createBatch method.
a partition id
The set of options that can be specified to influence the way in which events are sent to the associated Event Hub.
abortSignal
: A signal the request to cancel the send operation.Promise
Generated using TypeDoc
The client is the main point of interaction with Azure Event Hubs service. It offers connection to a specific Event Hub within the Event Hubs namespace along with operations for sending event data and inspecting the connected Event Hub.
There are multiple ways to create an
EventHubProducerClient
<yournamespace>.servicebus.windows.net
, and a credentials object.