danieljoos / libkafka-asio

C++ Kafka Client Library using Boost Asio
MIT License
76 stars 40 forks source link

missing feature: ability to send a correlation_id #3

Closed DEvil0000 closed 9 years ago

DEvil0000 commented 9 years ago

with the current API i don't see a way to send a correlation_id on produce.

danieljoos commented 9 years ago

There is a mutator set_correlation_id available on every request class. It is defined on the base request class in request.h. This is missing in the documentation. I will add this!

DEvil0000 commented 9 years ago

oh yes thanks - but it looks like I can not get it. when I call response->correlation_id() on the produce response I get assertion:

/development/Lib/boost-1.58.0/boost/optional/optional.hpp:1014: boost::optional<T>::pointer_const_type boost::optional<T>::operator->() const [with T = libkafka_asio::ProduceResponse, boost::optional<T>::pointer_const_type = const libkafka_asio::ProduceResponse*]: Assertion `this->is_initialized()' failed.
Aborted (core dumped)

EDIT: OK - you have to set request.set_required_acks(1); Maybe a default of 1 would make more sense Can get closed