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

ProducerClient can be used to send events to an Event Hub.

#include <producer_client.hpp>

Public Member Functions

std::string const & GetEventHubName ()
 
Azure::Core::Http::Policies::RetryOptions const & GetRetryOptions () const
 
 ProducerClient (ProducerClient const &other)=delete
 
ProducerClientoperator= (ProducerClient const &other)=delete
 
 ProducerClient (ProducerClient &&other)=delete
 
ProducerClientoperator= (ProducerClient &&other)=delete
 
 ProducerClient ()=default
 
 ProducerClient (std::string const &connectionString, std::string const &eventHub, ProducerClientOptions options={})
 Constructs a new ProducerClient instance.
 
 ProducerClient (std::string const &fullyQualifiedNamespace, std::string const &eventHub, std::shared_ptr< Azure::Core::Credentials::TokenCredential > credential, ProducerClientOptions options={})
 Constructs a new ProducerClient instance.
 
EventDataBatch CreateBatch (EventDataBatchOptions const &options={}, Azure::Core::Context const &context={})
 Create a new EventDataBatch to be sent to the Event Hub.
 
void Send (EventDataBatch const &eventDataBatch, Core::Context const &context={})
 Send an EventDataBatch to the remote Event Hub.
 
void Send (Models::EventData const &eventData, Core::Context const &context={})
 Send an EventData to the remote Event Hub.
 
void Send (std::vector< Models::EventData > const &eventData, Core::Context const &context={})
 Send a vector of EventData items to the remote Event Hub.
 
Models::EventHubProperties GetEventHubProperties (Core::Context const &context={})
 GetEventHubProperties gets properties of an eventHub. This includes data like name, and partitions.
 
Models::EventHubPartitionProperties GetPartitionProperties (std::string const &partitionID, Core::Context const &context={})
 GetPartitionProperties gets properties for a specific partition. This includes data like the last enqueued sequence number, the first sequence number and when an event was last enqueued to the partition.
 

Constructor & Destructor Documentation

◆ ProducerClient() [1/4]

Azure::Messaging::EventHubs::ProducerClient::ProducerClient ( ProducerClient const &  other)
delete

Create a ProducerClient from another ProducerClient.

◆ ProducerClient() [2/4]

Azure::Messaging::EventHubs::ProducerClient::ProducerClient ( )
default

Default Constructor for a ProducerClient

◆ ProducerClient() [3/4]

Azure::Messaging::EventHubs::ProducerClient::ProducerClient ( std::string const &  connectionString,
std::string const &  eventHub,
ProducerClientOptions  options = {} 
)
Parameters
connectionStringEvent hubs connection string
eventHubEvent hub name
optionsAdditional options for creating the client

◆ ProducerClient() [4/4]

Azure::Messaging::EventHubs::ProducerClient::ProducerClient ( std::string const &  fullyQualifiedNamespace,
std::string const &  eventHub,
std::shared_ptr< Azure::Core::Credentials::TokenCredential >  credential,
ProducerClientOptions  options = {} 
)
Parameters
fullyQualifiedNamespaceFully qualified namespace name
eventHubEvent hub name
credentialCredential to use for authentication
optionsAdditional options for creating the client

Member Function Documentation

◆ CreateBatch()

EventDataBatch Azure::Messaging::EventHubs::ProducerClient::CreateBatch ( EventDataBatchOptions const &  options = {},
Azure::Core::Context const &  context = {} 
)
Parameters
optionsOptional batch options
contextContext for the operation can be used for request cancellation.
Returns
newly created EventDataBatch object.

◆ GetEventHubName()

std::string const & Azure::Messaging::EventHubs::ProducerClient::GetEventHubName ( )
inline

Get the fully qualified namespace from the connection string

◆ GetEventHubProperties()

Models::EventHubProperties Azure::Messaging::EventHubs::ProducerClient::GetEventHubProperties ( Core::Context const &  context = {})
Parameters
contextContext for the operation can be used for request cancellation.

◆ GetPartitionProperties()

Models::EventHubPartitionProperties Azure::Messaging::EventHubs::ProducerClient::GetPartitionProperties ( std::string const &  partitionID,
Core::Context const &  context = {} 
)
Parameters
partitionIDpartition ID to detail.
contextContext for the operation can be used for request cancellation.

◆ GetRetryOptions()

Azure::Core::Http::Policies::RetryOptions const & Azure::Messaging::EventHubs::ProducerClient::GetRetryOptions ( ) const
inline

Get Retry options for this ProducerClient

◆ operator=()

ProducerClient & Azure::Messaging::EventHubs::ProducerClient::operator= ( ProducerClient const &  other)
delete

Assign a ProducerClient another ProducerClient.

◆ Send() [1/3]

void Azure::Messaging::EventHubs::ProducerClient::Send ( EventDataBatch const &  eventDataBatch,
Core::Context const &  context = {} 
)
Parameters
eventDataBatchBatch to send
contextRequest context

◆ Send() [2/3]

void Azure::Messaging::EventHubs::ProducerClient::Send ( Models::EventData const &  eventData,
Core::Context const &  context = {} 
)
Remarks
This method will create a new EventDataBatch and add the event to it. If the event exceeds the maximum size allowed by the Event Hubs service, an exception will be thrown.
Parameters
eventDataevent to send
contextRequest context

◆ Send() [3/3]

void Azure::Messaging::EventHubs::ProducerClient::Send ( std::vector< Models::EventData > const &  eventData,
Core::Context const &  context = {} 
)
Remarks
This method will create a new EventDataBatch and add the events to it. If the events exceeds the maximum size allowed by the Event Hubs service, an exception will be thrown.
Parameters
eventDataevents to send
contextRequest context

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