Add getters for Consumer callbacks

This commit is contained in:
Matias Fontanini
2016-06-25 08:42:04 -07:00
parent c300a9bf35
commit a2e7f6db0d
2 changed files with 27 additions and 0 deletions

View File

@@ -282,6 +282,21 @@ public:
*/
std::string get_member_id() const;
/**
* Gets the partition assignment callback.
*/
const AssignmentCallback& get_assignment_callback() const;
/**
* Gets the partition revocation callback.
*/
const RevocationCallback& get_revocation_callback() const;
/**
* Gets the rebalance error callback.
*/
const RebalanceErrorCallback& get_rebalance_error_callback() const;
/**
* \brief Polls for new messages
*

View File

@@ -180,6 +180,18 @@ string Consumer::get_member_id() const {
return rd_kafka_memberid(get_handle());
}
const Consumer::AssignmentCallback& Consumer::get_assignment_callback() const {
return assignment_callback_;
}
const Consumer::RevocationCallback& Consumer::get_revocation_callback() const {
return revocation_callback_;
}
const Consumer::RebalanceErrorCallback& Consumer::get_rebalance_error_callback() const {
return rebalance_error_callback_;
}
Message Consumer::poll() {
rd_kafka_message_t* message = rd_kafka_consumer_poll(get_handle(),
get_timeout().count());