The opaque pointer in dr_msg_cb is not set with the value passed in rd_kafka_produce
(gdb) bt
callback=callback@entry=0x426550 <rd_kafka_poll_cb>, opaque=opaque@entry=0x0) at rdkafka_queue.c:467
Pass a valid pointer in kafka_producer_send_data
Check if the pointer is set in the callback
Please provide the following information:
Git hash 4da1061ad1d993f446e54356b9dbc82f4ef52583
origin/0.11.0.x] [origin/HEAD] [origin/master]
[ x] Apache Kafka version:
0.10.2
[ ] librdkafka client configuration:
debug=.. as necessary) from librdkafkaCan you show the code that calls produce() and the dr_msg_cb code please?
Also note that the msg_opaque provided to produce() is rkmessage->_private in the dr_msg_cb, not the opaque argument.
https://github.com/edenhill/librdkafka/blob/master/src/rdkafka.h#L901
Hi
Below is the code snippet.
static void
dr_msg_cb (rd_kafka_t *rk,
const rd_kafka_message_t *rkmessage,
void *opaque)
{
kafka_conn_t *kafka_conn = opaque;
if (!kafka_conn) {
return;
}
::
::
}
vs_status_t
my_kafka_producer_send_data (my_kafka_conn_t kafka_conn,
char *buf, uint16_t len)
{
if (rd_kafka_produce(kafka_conn->kafka_rkt,
RD_KAFKA_PARTITION_UA,
RD_KAFKA_MSG_F_COPY,
buf, len,
NULL, 0, kafka_conn) == -1) {
/* Failed to enqueue message for producing. */
LOG_ERROR(LOG_CONN,
"Failed to produce to topic %s: %s\n",
rd_kafka_topic_name(kafka_conn->lced_kafka_rkt),
rd_kafka_err2str(rd_kafka_last_error()));
:
:
Looks like the issue may be with rd_kafka_produce as it does not
take rd_kafka_message_t as an argument.
rd_kafka_produce_batch might be ok as i can set the _private param
thx
roopa
:
On Wed, Jun 28, 2017 at 1:37 PM, Magnus Edenhill notifications@github.com
wrote:
Can you show the code that calls produce() and the dr_msg_cb code please?
Also note that the msg_opaque provided to produce() is rkmessage->_private
in the dr_msg_cb, not the opaque argument.
https://github.com/edenhill/librdkafka/blob/master/src/rdkafka.h#L901—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/edenhill/librdkafka/issues/1288#issuecomment-311781712,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AcVgbIw1kyNTKrTmqx41MirxvrxY9Ifoks5sIrl7gaJpZM4OIeau
.
The msg_opaque argument to produce() will be made available as rkmessage->_private in the dr_msg_cb.
The opaque argument of dr_msg_cb is the rd_kafka_t-level global opaque.
Thanks for the clarification.
Regards
roopa
On Wed, Jun 28, 2017 at 1:58 PM, Magnus Edenhill notifications@github.com
wrote:
The msg_opaque argument to produce() will be made available as
rkmessage->_private in the dr_msg_cb.
The opaque argument of dr_msg_cb is the rd_kafka_t-level global opaque.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/edenhill/librdkafka/issues/1288#issuecomment-311788585,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AcVgbEOg0SYi_DgNOJQBV5gn1ooa9nvNks5sIr5vgaJpZM4OIeau
.