azure-messaging-eventhubs
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Azure::Messaging::EventHubs::EventDataBatch Class Referencefinal

EventDataBatch is used to efficiently pack up EventData before sending it to Event Hubs. More...

#include <event_data_batch.hpp>

Public Member Functions

 EventDataBatch (EventDataBatch const &other)
 Constructs an EventDataBatch from another EventDataBatch.
 
EventDataBatchoperator= (EventDataBatch const &other)
 
 EventDataBatch (EventDataBatchOptions options={})
 Event Data Batch constructor.
 
std::string GetPartitionId () const
 Gets the partition ID for the data batch.
 
std::string GetPartitionKey () const
 Gets the partition key for the data batch.
 
uint64_t GetMaxBytes () const
 Gets the maximum size of the data batch.
 
void AddMessage (Azure::Core::Amqp::Models::AmqpMessage message)
 Adds a message to the data batch.
 
void AddMessage (Azure::Messaging::EventHubs::Models::EventData &message)
 Adds a message to the data batch.
 
size_t CurrentSize ()
 Gets the number of messages in the batch.
 
Azure::Core::Amqp::Models::AmqpMessage ToAmqpMessage () const
 Serializes the EventDataBatch to a single AmqpMessage to be sent to the EventHubs service.
 

Detailed Description

Remarks
EventDataBatch's are not meant to be created directly. Use [ProducerClient.CreateEventDataBatch], which will create them with the proper size limit for your Event Hub.

Constructor & Destructor Documentation

◆ EventDataBatch() [1/2]

Azure::Messaging::EventHubs::EventDataBatch::EventDataBatch ( EventDataBatch const &  other)
inline
Parameters
otherThe EventDataBatch to copy

◆ EventDataBatch() [2/2]

Azure::Messaging::EventHubs::EventDataBatch::EventDataBatch ( EventDataBatchOptions  options = {})
inline
Parameters
optionsOptions settings for creating the data batch

Member Function Documentation

◆ AddMessage() [1/2]

void Azure::Messaging::EventHubs::EventDataBatch::AddMessage ( Azure::Core::Amqp::Models::AmqpMessage  message)
inline
Parameters
messageThe message to add to the batch

◆ AddMessage() [2/2]

void Azure::Messaging::EventHubs::EventDataBatch::AddMessage ( Azure::Messaging::EventHubs::Models::EventData message)
Parameters
messageThe message to add to the batch

◆ CurrentSize()

size_t Azure::Messaging::EventHubs::EventDataBatch::CurrentSize ( )
inline

◆ GetMaxBytes()

uint64_t Azure::Messaging::EventHubs::EventDataBatch::GetMaxBytes ( ) const
inline
Returns
uint64_t

◆ GetPartitionId()

std::string Azure::Messaging::EventHubs::EventDataBatch::GetPartitionId ( ) const
inline
Returns
std::string

◆ GetPartitionKey()

std::string Azure::Messaging::EventHubs::EventDataBatch::GetPartitionKey ( ) const
inline
Returns
std::string

◆ operator=()

EventDataBatch & Azure::Messaging::EventHubs::EventDataBatch::operator= ( EventDataBatch const &  other)
inline

Copy an EventDataBatch to another EventDataBatch

◆ ToAmqpMessage()

Azure::Core::Amqp::Models::AmqpMessage Azure::Messaging::EventHubs::EventDataBatch::ToAmqpMessage ( ) const
Returns
Azure::Core::Amqp::Models::AmqpMessage

The documentation for this class was generated from the following files: