pulsar-client-cpp
Loading...
Searching...
No Matches
ProducerInterceptor.h
1
20#ifndef PULSAR_PRODUCER_INTERCEPTOR_H
21#define PULSAR_PRODUCER_INTERCEPTOR_H
22
23#include <pulsar/Message.h>
24#include <pulsar/Result.h>
25#include <pulsar/defines.h>
26
27namespace pulsar {
28
29class Producer;
30
42class PULSAR_PUBLIC ProducerInterceptor {
43 public:
44 virtual ~ProducerInterceptor() {}
45
49 virtual void close() {}
50
80 virtual Message beforeSend(const Producer& producer, const Message& message) = 0;
81
99 virtual void onSendAcknowledgement(const Producer& producer, Result result, const Message& message,
100 const MessageId& messageID) = 0;
101
108 virtual void onPartitionsChange(const std::string& topicName, int partitions) {}
109};
110
111typedef std::shared_ptr<ProducerInterceptor> ProducerInterceptorPtr;
112} // namespace pulsar
113
114#endif // PULSAR_PRODUCER_INTERCEPTOR_H
Definition Message.h:44
Definition MessageId.h:34
Definition Producer.h:36
Definition ProducerInterceptor.h:42
virtual void close()
Definition ProducerInterceptor.h:49
virtual void onPartitionsChange(const std::string &topicName, int partitions)
Definition ProducerInterceptor.h:108
virtual void onSendAcknowledgement(const Producer &producer, Result result, const Message &message, const MessageId &messageID)=0
virtual Message beforeSend(const Producer &producer, const Message &message)=0
Definition Authentication.h:31
Result
Definition Result.h:32