apache-kafka

Does Kafka python API support stream processing?

Does Kafka python API support stream processing? Question: I have used Kafka Streams in Java. I could not find similar API in python. Do Apache Kafka support stream processing in python? Asked By: user3126637 || Source Answers: Kafka Streams is only available as a JVM library, but there are a few comparable Python implementations of …

Total answers: 3

Do we need to manually cache schema registry?

Do we need to manually cache schema registry? Question: We are currently using Protocol Buffers as serialization mechanism for kafak message. We are going to move to Avro. We tested Avro Confluent consumer with Schema Registry and according to those tests, Avro consumer is little bit slow compare to protobuff consumer. My question is do …

Total answers: 2

How to read batch messages in confluent kafka python?

How to read batch messages in confluent kafka python? Question: I am trying to read messages from Kafka, so I have written simple consumer to read messages from Kafka. While True: message = consumer.poll(timeout=1.0) # i am doing something with messages in above code output of message type is message object. how can I get …

Total answers: 2

How to decode/deserialize Avro with Python from Kafka

How to decode/deserialize Avro with Python from Kafka Question: I am receiving from a remote server Kafka Avro messages in Python (using the consumer of Confluent Kafka Python library), that represent clickstream data with json dictionaries with fields like user agent, location, url, etc. Here is what a message looks like: b’x01x00x00xdex9exa8xd5x8fWxecx9axa8xd5x8fWx1axxx.xxx.xxx.xxxx02:https://website.in/rooms/x02Hhttps://website.in/wellness-spa/x02xaax14x02x9cnx02xaax14x02xd0x0bx02V0:j3lcu1if:rTftGozmxSPo96dz1kGH2hvd0CREXmf2x02V0:j3lj1xt7:YD4daqNRv_Vsea4wuFErpDaWeHu4tW7ex02x08nullx02nnull0x10pageviewx00x00x00x00x00x00x00x00x00x02x10Thailandx02xa6x80xc4x01x02x0eBangkokx02x8cxbaxc4x01x020*xa9x13xd0x84+@x02xecxc09#Jx1fY@x02x8ax02Mozilla/5.0 (X11; Linux x86_64) …

Total answers: 4

Kafka Error INVALID_ARG No Such configuration property sasl.mechanisms when using confluent-kafka-python

Kafka Error INVALID_ARG No Such configuration property sasl.mechanisms when using confluent-kafka-python Question: When trying to use the Message Hub Bluemix service with confluent-kafka-python, I am getting the ERROR Uncaught exception: , KafkaError{code=_INVALID_ARG,val=-186,str=”No such configuration property: “sasl.mechanisms””} Asked By: ValerieLampkin || Source Answers: This error indicates that librdkafka (the library confluent-kafka-python wraps) has not been compiled …

Total answers: 2

Encoding / formatting issues with python kafka library

Encoding / formatting issues with python kafka library Question: I’ve been trying to use the python kafka library for a bit now and can’t get a producer to work. After a bit of research I’ve found out that kafka sends (and I’m guessing expects as well) an additional 5 byte header (one 0 byte, one …

Total answers: 2

NoBrokersAvailable: NoBrokersAvailable-Kafka Error

NoBrokersAvailable: NoBrokersAvailable-Kafka Error Question: i have already started to learn Kafka. Trying basic operations on it. I have stucked on a point which about the ‘Brokers’. My kafka is running but when i want to create a partition. from kafka import TopicPartition (ERROR THERE) consumer = KafkaConsumer(bootstrap_servers=’localhost:1234′) consumer.assign([TopicPartition(‘foobar’, 2)]) msg = next(consumer) traceback (most recent …

Total answers: 7

How to get latest offset for a partition for a kafka topic?

How to get latest offset for a partition for a kafka topic? Question: I am using the Python high level consumer for Kafka and want to know the latest offsets for each partition of a topic. However I cannot get it to work. from kafka import TopicPartition from kafka.consumer import KafkaConsumer con = KafkaConsumer(bootstrap_servers = …

Total answers: 8