7#include "event_data_batch.hpp"
8#include "models/management_models.hpp"
10#include <azure/core/amqp.hpp>
11#include <azure/core/amqp/management.hpp>
12#include <azure/core/context.hpp>
13#include <azure/core/credentials/credentials.hpp>
14#include <azure/core/http/policies/policy.hpp>
18namespace Azure {
namespace Messaging {
namespace EventHubs {
46 std::string m_connectionString;
49 std::string m_fullyQualifiedNamespace;
52 std::string m_eventHub{};
55 std::string m_targetUrl{};
58 std::shared_ptr<Core::Credentials::TokenCredential> m_credential{};
61 std::map<std::string, Azure::Core::Amqp::_internal::MessageSender> m_senders{};
62 std::map<std::string, Azure::Core::Amqp::_internal::Session> m_sessions{};
90 std::string
const& connectionString,
91 std::string
const& eventHub,
102 std::string
const& fullyQualifiedNamespace,
103 std::string
const& eventHub,
104 std::shared_ptr<Azure::Core::Credentials::TokenCredential> credential,
109 for (
auto& sender : m_senders)
111 sender.second.Close();
122 EventDataBatch
const& eventDataBatch,
123 Core::Context
const& context = {});
140 std::string
const& partitionID,
141 Core::Context
const& context = {});
144 Azure::Core::Amqp::_internal::MessageSender GetSender(std::string
const& partitionId =
"");
145 void CreateSender(std::string
const& partitionId =
"");
ProducerClient can be used to send events to an Event Hub.
Definition producer_client.hpp:44
std::string const & GetEventHubName()
Definition producer_client.hpp:66
ProducerClient & operator=(ProducerClient const &other)=default
bool SendEventDataBatch(EventDataBatch const &eventDataBatch, Core::Context const &context={})
Proceeds to send and EventDataBatch.
Definition producer_client.cpp:95
ProducerClient(ProducerClient const &other)=default
Models::EventHubPartitionProperties GetPartitionProperties(std::string const &partitionID, Core::Context const &context={})
GetPartitionProperties gets properties for a specific partition. This includes data like the last enq...
Definition producer_client.cpp:129
Models::EventHubProperties GetEventHubProperties(Core::Context const &context={})
GetEventHubProperties gets properties of an eventHub. This includes data like name,...
Definition producer_client.cpp:117
Azure::Core::Http::Policies::RetryOptions const & GetRetryOptions()
Definition producer_client.hpp:69
Contains options for the ProducerClient creation.
Definition producer_client.hpp:23
Azure::Core::Http::Policies::RetryOptions RetryOptions
RetryOptions controls how often operations are retried from this client and any Receivers and Senders...
Definition producer_client.hpp:31
Azure::Nullable< std::uint64_t > MaxMessageSize
The maximum size of the message that can be sent.
Definition producer_client.hpp:39
std::string Name
The name of the producer client link, used in diagnostics.
Definition producer_client.hpp:35
std::string ApplicationID
Application ID that will be passed to the namespace.
Definition producer_client.hpp:26