Allow setting timestamp on produced messages

This commit is contained in:
Matias Fontanini
2017-04-16 15:22:17 -07:00
parent 9ecad71be1
commit 6c47b1a190
3 changed files with 74 additions and 21 deletions

View File

@@ -70,8 +70,9 @@ void Producer::produce(const MessageBuilder& builder) {
RD_KAFKA_V_TOPIC(builder.topic().data()),
RD_KAFKA_V_PARTITION(builder.partition()),
RD_KAFKA_V_MSGFLAGS(policy),
RD_KAFKA_V_VALUE((void*)payload.get_data(), payload.get_size()),
RD_KAFKA_V_TIMESTAMP(builder.timestamp().count()),
RD_KAFKA_V_KEY((void*)key.get_data(), key.get_size()),
RD_KAFKA_V_VALUE((void*)payload.get_data(), payload.get_size()),
RD_KAFKA_V_OPAQUE(builder.user_data()),
RD_KAFKA_V_END);
check_error(result);