Tries to add an event data to the batch if permitted by the batch's size limit. NOTE: Always remember to check the return value of this method, before calling it again for the next event.
An individual event data object.
A boolean value indicating if the event data has been added to the batch or not.
Generated using TypeDoc
A class representing a batch of events which can be passed to the
send
method of aEventProducer
instance. This batch is ensured to be under the maximum message size supported by Azure Event Hubs service.Use
createBatch()
method on theEventHubProducer
to create an instance ofEventDataBatch
instead of usingnew EventDataBatch()
. You can specify an upper limit for the size of the batch via options when callingcreateBatch()
.Use the
tryAdd
function on the EventDataBatch to add events to the batch. This method will returnfalse
after the upper limit is reached, therefore check the result before callingtryAdd()
again.