Skip to content

AttributeError: 'cimpl.Message' object has no attribute 'timestamp' #81

Closed
@drazenzubovic

Description

@drazenzubovic

We encounter issues when running an integration_test.py on macOS. They could be related to the incompatibility with the c implementation of Kafka in librdkafka and the python wrapper.

System components:
OS: Sierra 10.12.1
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 26 2016, 12:10:39)
librdkafka: stable 0.9.2 (bottled)
confluent-kafka (0.9.2)

Issue 1:
('==============================', 'Verifying Consumer', '==============================') Traceback (most recent call last): File "/Users/drazen/Documents/audi/workspace/confluent-kafka-python-master/examples/integration_test.py", line 465, in <module> verify_consumer() File "/Users/drazen/Documents/audi/workspace/confluent-kafka-python-master/examples/integration_test.py", line 259, in verify_consumer tstype, timestamp = msg.timestamp() AttributeError: 'cimpl.Message' object has no attribute 'timestamp'

in code snippet ...

tstype, timestamp = msg.timestamp()

Issue 2:
('==============================', 'Verifying stats_cb', '==============================') Traceback (most recent call last): File "/Users/drazen/Documents/audi/workspace/confluent-kafka-python-master/examples/integration_test.py", line 477, in <module> verify_stats_cb() File "/Users/drazen/Documents/audi/workspace/confluent-kafka-python-master/examples/integration_test.py", line 393, in verify_stats_cb c = confluent_kafka.Consumer(**conf) cimpl.KafkaException: KafkaError{code=_INVALID_ARG,val=-186,str="Property "stats_cb" must be set through dedicated .._set_..() function"}

in code snippet ...

conf = {'bootstrap.servers': bootstrap_servers,
'group.id': uuid.uuid1(),
'session.timeout.ms': 6000,
'error_cb': error_cb,
'stats_cb': stats_cb,
'statistics.interval.ms': 200,
'default.topic.config': {
'auto.offset.reset': 'earliest'
}}
c = confluent_kafka.Consumer(**conf)

Once the conflicting code is commented out, the rest of example will run through.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions