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)
 
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.
 
bool TryAddMessage (std::shared_ptr< Azure::Core::Amqp::Models::AmqpMessage const > const &message)
 Attempts to add a raw AMQP message to the data batch.
 
bool TryAddMessage (Azure::Messaging::EventHubs::Models::EventData const &message)
 Attempts to add 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()

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

Member Function Documentation

◆ 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

◆ TryAddMessage() [1/2]

bool Azure::Messaging::EventHubs::EventDataBatch::TryAddMessage ( Azure::Messaging::EventHubs::Models::EventData const &  message)
Parameters
messageThe message to add to the batch
Returns
true if the message was added to the batch, false otherwise.

◆ TryAddMessage() [2/2]

bool Azure::Messaging::EventHubs::EventDataBatch::TryAddMessage ( std::shared_ptr< Azure::Core::Amqp::Models::AmqpMessage const > const &  message)
inline
Parameters
messageThe AMQP message to add to the batch
Returns
true if the message was added to the batch, false otherwise.

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