4#include "checkpoint_store.hpp"
5#include "consumer_client.hpp"
7namespace Azure {
namespace Messaging {
namespace EventHubs {
39 std::vector<std::shared_ptr<const Models::ReceivedEventData>>
ReceiveEvents(
40 uint32_t maxBatchSize,
41 Core::Context
const& context = {})
43 return m_partitionClient->ReceiveEvents(maxBatchSize, context);
55 std::shared_ptr<const Models::ReceivedEventData>
const& eventData,
56 Core::Context
const& context = {});
65 void Close(Core::Context
const& context = {})
71 m_partitionClient->Close(context);
75 std::string m_partitionId;
76 std::unique_ptr<PartitionClient> m_partitionClient{};
77 std::shared_ptr<CheckpointStore> m_checkpointStore;
78 std::function<void()> m_cleanupFunc;
79 Models::ConsumerClientDetails m_consumerClientDetails;
87 ProcessorPartitionClient(
88 std::string partitionId,
89 std::shared_ptr<CheckpointStore> checkpointStore,
90 Models::ConsumerClientDetails consumerClientDetails,
91 std::function<
void()> cleanupFunc)
92 : m_partitionId(partitionId), m_checkpointStore(checkpointStore),
93 m_cleanupFunc(cleanupFunc), m_consumerClientDetails(consumerClientDetails)
97 void SetPartitionClient(std::unique_ptr<PartitionClient>& partitionClient)
99 m_partitionClient = std::move(partitionClient);
103 Azure::Core::Amqp::Models::AmqpMessage
const& amqpMessage,
104 Core::Context
const& context = {});
105 std::string GetPartitionId() {
return m_partitionId; }
Processor uses a ConsumerClient and CheckpointStore to provide automatic load balancing between multi...
Definition processor.hpp:84
ProcessorPartitionClient allows you to receive events, similar to a [PartitionClient],...
Definition processor_partition_client.hpp:17
void Close(Core::Context const &context={})
Closes the partition client.
Definition processor_partition_client.hpp:65
void UpdateCheckpoint(std::shared_ptr< const Models::ReceivedEventData > const &eventData, Core::Context const &context={})
Updates the checkpoint for this partition using the given event data.
Definition processor_partition_client.cpp:67
std::string PartitionId() const
Returns the partition ID associated with this ProcessorPartitionClient.
Definition processor_partition_client.hpp:59
ProcessorPartitionClient & operator=(ProcessorPartitionClient &&other)=default
Move a ProcessorPartitionClient to another.
ProcessorPartitionClient(ProcessorPartitionClient &&other)=default
Move a ProcessorPartitionClient to another.
ProcessorPartitionClient(ProcessorPartitionClient const &other)=delete
Copy a ProcessorPartitionClient to another ProcessorPartitionClient.
std::vector< std::shared_ptr< const Models::ReceivedEventData > > ReceiveEvents(uint32_t maxBatchSize, Core::Context const &context={})
Definition processor_partition_client.hpp:39
ProcessorPartitionClient & operator=(ProcessorPartitionClient const &other)=delete
Assignment operator.