Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to mock "cppkafka::Message" in unittest? #275

Open
qq911712051 opened this issue Mar 30, 2021 · 2 comments
Open

how to mock "cppkafka::Message" in unittest? #275

qq911712051 opened this issue Mar 30, 2021 · 2 comments

Comments

@qq911712051
Copy link

No description provided.

@qq911712051
Copy link
Author

the only way I can find now is to set the handle_ variable in Message and release it manually

@jheffersonalves
Copy link

jheffersonalves commented Jul 5, 2023

How to create cppkafka::Message safety? Some times i get "Bus error" creating Message from make_on_owning static function.
Example:

`

std::string payload("message from string");
rd_kafka_message_t* l_struct_msg = new rd_kafka_message_t;
l_struct_msg->err = rd_kafka_resp_err_t::RD_KAFKA_RESP_ERR_NO_ERROR;
l_struct_msg->payload = &payload[0];
l_struct_msg->len = payload.size();
l_struct_msg->key_len = 0;

cppkafka::Message cppkafka_message;
cppkafka_message = cppkafka::Message::make_non_owning(l_struct_msg);

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants