Rosy
Rosy

Reputation: 51

KAFKA Messages are getting timed out

I have configured the Kafka Cluster and the schema registry using https://techcommunity.microsoft.com/t5/analytics-on-azure-blog/hdinsight-managed-kafka-with-oss-kafka-schema-registry/ba-p/1500679.

I'm trying to execute https://github.com/confluentinc/confluent-kafka-python/blob/master/examples/avro_producer.py as below but the messages are getting timeout

 ```

python3 avro_producer.py -b $KAFKABROKERS -s  http://localhost:8081 -t user-generic
Producing user records to topic user-generic. ^C to exit.
Enter name: sdfsdj
Enter address: kdsjflskdjflks
Enter favorite number: 43534
Enter favorite color: sdfsdfssdfdf
Enter name: rerwe
Enter address: sfvsgffdfhfgh
Enter favorite number: 34534
Enter favorite color: fdgdfgdfg
Enter name: ^C
Flushing records...
Delivery failed for User record b'027d1ace-5123-4599-af40-f86bba79d858': KafkaError{code=_MSG_TIMED_OUT,val=-192,str="Local: Message timed out"}
Delivery failed for User record b'fbd89258-8324-4e97-957d-c0cd1307f707': KafkaError{code=_MSG_TIMED_OUT,val=-192,str="Local: Message timed out"}

But when i use below piece of code, the messages are getting processed.

    /usr/bin/kafka-avro-console-producer     --broker-list $KAFKABROKERS     --topic agkafkaschemareg     --property parse.key=true --property key.schema='{"type" : "int", "name" : "id"}'     --property value.schema='{ "type" : "record", "name" : "example_schema", "namespace" : "com.example", "fields" : [ { "name" : "cust_id", "type" : "int", "doc" : "Id of the customer account" }, { "name" : "year", "type" : "int", "doc" : "year of expense" }, { "name" : "expenses", "type" : {"type": "array", "items": "float"}, "doc" : "Expenses for the year" } ], "doc:" : "A basic schema for storing messages" }'

Upvotes: 0

Views: 133

Answers (0)

Related Questions