Can you confirm that there are indeed messages in the topic that you
published to?

bin/kafka-console-consumer.sh --zookeeper [details] --topic [topic]
--from-beginning

That should be the right command, and you can use that to first verify that
messages have indeed been published to the topic in question.
ᐧ

On Tue, Jul 28, 2015 at 11:33 AM, Keith Wiley <keith.wi...@atigeo.com>
wrote:

> I'm trying to get a basic consumer off the ground.  I can create the
> consumer but I can't do anything at the message level:
>
>
> consumer = KafkaConsumer(topic,
>                          group_id=group_id,
>                          bootstrap_servers=[ip + ":" + port])
>
> for m in consumer:
>     print "x"
>
> Note that I'm not even trying to use the message, I'm just trying loop
> over the consumer.  I'm getting an exception there somehow:
>
>
> Exception: No topics or partitions configured
> Traceback (most recent call last):
>   File "<timed exec>", line 3, in <module>
>   File "/usr/local/lib/python2.7/dist-packages/kafka/consumer/kafka.py",
> line 290, in next
>     return six.next(self._get_message_iterator())
>   File "/usr/local/lib/python2.7/dist-packages/kafka/consumer/kafka.py",
> line 324, in fetch_messages
>     raise KafkaConfigurationError('No topics or partitions configured')
> KafkaConfigurationError: No topics or partitions configured
>
>
> Any ideas?  I've been assured (although perhaps incorrectly) that the
> producer is configured, up and running.  Thanks.
>
>
> Keith Wiley
> Senior Software Engineer, Atigeo
> keith.wi...@atigeo.com
>
> [atigeo]<http://atigeo.com/>
> [twitter]<https://twitter.com/atigeo> [LinkedIn] <
> https://www.linkedin.com/company/atigeo>  [YouTube] <
> https://www.youtube.com/user/AtigeoXpatterns/>  [blog] <
> http://xpatterns.com/blog/>
>
>


-- 

Jiefu Gong
University of California, Berkeley | Class of 2017
B.A Computer Science | College of Letters and Sciences

jg...@berkeley.edu <elise...@berkeley.edu> | (925) 400-3427

Reply via email to