pulsar-client-cpp
Loading...
Searching...
No Matches
Producer.h
1
19#ifndef PRODUCER_HPP_
20#define PRODUCER_HPP_
21
22#include <pulsar/ProducerConfiguration.h>
23#include <pulsar/defines.h>
24#include <stdint.h>
25
26#include <memory>
27
28namespace pulsar {
29class ProducerImplBase;
30class PulsarWrapper;
31class PulsarFriend;
32
33typedef std::function<void(Result)> FlushCallback;
34typedef std::shared_ptr<ProducerImplBase> ProducerImplBasePtr;
35
36class PULSAR_PUBLIC Producer {
37 public:
42
46 const std::string& getTopic() const;
47
51 const std::string& getProducerName() const;
52
58 Result send(const Message& msg);
59
84 Result send(const Message& msg, MessageId& messageId);
85
100 void sendAsync(const Message& msg, SendCallback callback);
101
107
112 void flushAsync(FlushCallback callback);
113
126 int64_t getLastSequenceId() const;
127
136 const std::string& getSchemaVersion() const;
137
148
156 void closeAsync(CloseCallback callback);
157
161 bool isConnected() const;
162
163 private:
164 explicit Producer(ProducerImplBasePtr);
165
166 friend class ClientImpl;
167 friend class PulsarFriend;
168 friend class PulsarWrapper;
169 friend class ProducerImpl;
170
171 ProducerImplBasePtr impl_;
172
173 // For unit test case BatchMessageTest::producerFailureResult only
174 void producerFailMessages(Result result);
175};
176} // namespace pulsar
177
178#endif /* PRODUCER_HPP_ */
Definition Message.h:44
Definition MessageId.h:34
Definition Producer.h:36
bool isConnected() const
const std::string & getSchemaVersion() const
void flushAsync(FlushCallback callback)
Result send(const Message &msg, MessageId &messageId)
void closeAsync(CloseCallback callback)
void sendAsync(const Message &msg, SendCallback callback)
int64_t getLastSequenceId() const
const std::string & getTopic() const
const std::string & getProducerName() const
Result send(const Message &msg)
Definition Authentication.h:31
Result
Definition Result.h:32