producer rd_kafka_poll #4250
Unanswered
GilbertoTheMighty
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello I'm using rf_kafka to produce a lot of messages. I'm not using any delivery events, so I don't do rd_kafka_poll at all. My config looks like this:
bootstrap.servers: "127.0.0.1:9092,127.0.0.2:9092,127.0.0.3:9092" queue.buffering.max.messages: 0 queue.buffering.max.kbytes: 2147483647 queue.buffering.max.ms: 1000 batch.size: 524288 compression.type: gzip acks: all enable.idempotence: true
Here is the code how I send the message:
`rd_kafka_resp_err_t producev(const std::string &data)
{
return rd_kafka_producev(producer,
RD_KAFKA_V_TOPIC(topic.c_str()),
RD_KAFKA_V_MSGFLAGS(RD_KAFKA_MSG_F_COPY),
RD_KAFKA_V_KEY("", 0),
RD_KAFKA_V_VALUE((void *)data.c_str(), strlen(data.c_str())),
RD_KAFKA_V_OPAQUE(NULL),
RD_KAFKA_V_END);
}
void produce()
{
pthread_setname_np(pthread_self(), topic.substr(topic.length() - 15).c_str());
I expect all messages to be delivered. But It seems that kafka loses some of them. I detect missed messages in database. What is the problem, should I use poll if I'm not using any events?
Beta Was this translation helpful? Give feedback.
All reactions