Added compile time check for store_offsets() api

This commit is contained in:
accelerated
2019-02-06 17:47:02 -05:00
parent 4f4c9e9c91
commit e19d84b839
3 changed files with 5 additions and 2 deletions

View File

@@ -200,6 +200,7 @@ Consumer::get_offsets_position(const TopicPartitionList& topic_partitions) const
return convert(topic_list_handle);
}
#if (RD_KAFKA_VERSION >= RD_KAFKA_STORE_OFFSETS_SUPPORT_VERSION)
void Consumer::store_consumed_offsets() const {
store_offsets(get_offsets_position(get_assignment()));
}
@@ -209,6 +210,7 @@ void Consumer::store_offsets(const TopicPartitionList& topic_partitions) const {
rd_kafka_resp_err_t error = rd_kafka_offsets_store(get_handle(), topic_list_handle.get());
check_error(error, topic_list_handle.get());
}
#endif
void Consumer::store_offset(const Message& msg) const {
rd_kafka_resp_err_t error = rd_kafka_offset_store(msg.get_handle()->rkt, msg.get_partition(), msg.get_offset());