Skip to content

Commit def5680

Browse files
committed
Fix producev() detection (#115)
1 parent 7bef980 commit def5680

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

confluent_kafka/src/Producer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ static PyObject *Producer_produce (Handle *self, PyObject *args,
325325
if (timestamp) {
326326
PyErr_Format(PyExc_NotImplementedError,
327327
"Producer timestamps require librdkafka "
328-
"version >=v0.9.3 (currently on %s)",
328+
"version >=v0.9.4 (currently on %s)",
329329
rd_kafka_version_str());
330330
return NULL;
331331
}
@@ -461,7 +461,7 @@ static PyMethodDef Producer_methods[] = {
461461
" :param func on_delivery(err,msg): Delivery report callback to call "
462462
"(from :py:func:`poll()` or :py:func:`flush()`) on successful or "
463463
"failed delivery\n"
464-
" :param int timestamp: Message timestamp (CreateTime) in microseconds since epoch UTC (requires librdkafka >= v0.9.3, api.version.request=true, and broker >= 0.10.0.0). Default value is current time.\n"
464+
" :param int timestamp: Message timestamp (CreateTime) in microseconds since epoch UTC (requires librdkafka >= v0.9.4, api.version.request=true, and broker >= 0.10.0.0). Default value is current time.\n"
465465
"\n"
466466
" :rtype: None\n"
467467
" :raises BufferError: if the internal producer message queue is "
@@ -495,7 +495,7 @@ static PyMethodDef Producer_methods[] = {
495495
" This is a convenience method that calls :py:func:`poll()` until "
496496
":py:func:`len()` is zero or the optional timeout elapses.\n"
497497
"\n"
498-
" :param: float timeout: Maximum time to block (requires librdkafka >= v0.9.3).\n"
498+
" :param: float timeout: Maximum time to block (requires librdkafka >= v0.9.4).\n"
499499
" :returns: Number of messages still in queue.\n"
500500
"\n"
501501
".. note:: See :py:func:`poll()` for a description on what "

confluent_kafka/src/confluent_kafka.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/**
3030
* librdkafka feature detection
3131
*/
32-
#if RD_KAFKA_VERSION >= 0x00090300
32+
#ifdef RD_KAFKA_V_TIMESTAMP
3333
#define HAVE_PRODUCEV 1 /* rd_kafka_producev() */
3434
#endif
3535

examples/integration_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def verify_producer():
120120
try:
121121
p.produce(topic, value='with a timestamp', timestamp=123456789000)
122122
except NotImplementedError:
123-
if confluent_kafka.libversion()[1] >= 0x00090300:
123+
if confluent_kafka.libversion()[1] >= 0x00090400:
124124
raise
125125

126126
# Produce even more messages

tests/test_Producer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ def test_produce_timestamp():
4242
'error_cb': error_cb,
4343
'default.topic.config': {'message.timeout.ms': 10}})
4444

45-
# Requires librdkafka >=v0.9.3
45+
# Requires librdkafka >=v0.9.4
4646

4747
try:
4848
p.produce('mytopic', timestamp=1234567)
4949
except NotImplementedError:
5050
# Should only fail on non-supporting librdkafka
51-
if libversion()[1] >= 0x00090300:
51+
if libversion()[1] >= 0x00090400:
5252
raise
5353

5454
p.flush()

0 commit comments

Comments
 (0)