Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Issue with SimpleConsumer  #44

Closed
Closed
@fozzmarc

Description

@fozzmarc

Hi,
I'm new to kafka, I'm using kafka-0.8.0
the code looks like

kafka = KafkaClient("localhost", 9092)
consumer = SimpleConsumer(kafka, "my-group", "test")
for message in consumer:
    print message

When runing ,it'll be stuck here

OffsetAndMessage(offset=166799, message=Message(magic=0, attributes=0, key=None, value='{"topic": "test", "content": "test"}'))
Traceback (most recent call last):
  File "run.py", line 8, in <module>
    kfk.recv_message()
  File "/usr/local/websoft/kafka_server_side/kfk.py", line 30, in recv_message
    for message in self.consumer:
  File "build/bdist.linux-x86_64/egg/kafka/consumer.py", line 340, in __iter__
  File "build/bdist.linux-x86_64/egg/kafka/consumer.py", line 161, in _auto_commit
  File "build/bdist.linux-x86_64/egg/kafka/consumer.py", line 145, in commit
  File "build/bdist.linux-x86_64/egg/kafka/client.py", line 290, in send_offset_commit_request
  File "build/bdist.linux-x86_64/egg/kafka/client.py", line 168, in _send_broker_aware_request
  File "build/bdist.linux-x86_64/egg/kafka/conn.py", line 83, in recv
  File "build/bdist.linux-x86_64/egg/kafka/conn.py", line 37, in _consume_response
  File "build/bdist.linux-x86_64/egg/kafka/conn.py", line 51, in _consume_response_iter
Exception: Got no response from Kafka
Exception NameError: "global name 'ConsumerNoMoreData' is not defined" in <generator object __iter_partition__ at 0x11b6190> ignored

Producer is working fine and it never stop, I can get the message from kafka-console client .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions