You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by "wanglei2@geekplus.com.cn" <wa...@geekplus.com.cn> on 2020/05/08 09:53:12 UTC

Is it possible to send avro serialized data to kafka using kafka-console-producer.sh

I can consume avro serialized data from kafka like this:

bin/kafka-console-consumer.sh --bootstrap-server xxx:9092 --topic xxx --property print.key=true --formatter io.confluent.kafka.formatter.AvroMessageFormatter --property schema.registry.url=http://xxx:8088 

It is possible to send avro serialized data to kafka using kafka-console-producer.sh?

Thanks,
Lei


wanglei2@geekplus.com.cn


Re: Re: Is it possible to send avro serialized data to kafka using kafka-console-producer.sh

Posted by "wanglei2@geekplus.com.cn" <wa...@geekplus.com.cn>.
The  kafka-avro-console-producer is only in conflunet kafka.  But i am using apache kafka. 

Seems apache kafka  kafka-console-producer is not able to send avro serialazed data to kafka, 
                            but kafka-console-consumer can read avro serialized data. 

I have tried, confluent  kafka-avro-console-producer send to apache  kafka, 
                    apache kafka-console-consumer.sh  can read it.

Thanks,
Lei



wanglei2@geekplus.com.cn 


From: Miguel Silvestre
Date: 2020-05-08 19:41
To: users
Subject: Re: Is it possible to send avro serialized data to kafka using kafka-console-producer.sh
Hi,
 
check kafka-avro-console-producer
 
./bin/kafka-avro-console-producer \
         --broker-list localhost:9092 --topic test \
         --property
value.schema='{"type":"record","name":"myrecord","fields":[{"name":"f1","type":"string"}]}'
 
https://docs.confluent.io/3.0.0/quickstart.html
 
--
Miguel Silvestre
 
 
On Fri, May 8, 2020 at 10:53 AM wanglei2@geekplus.com.cn <
wanglei2@geekplus.com.cn> wrote:
 
>
> I can consume avro serialized data from kafka like this:
>
> bin/kafka-console-consumer.sh --bootstrap-server xxx:9092 --topic xxx
> --property print.key=true --formatter
> io.confluent.kafka.formatter.AvroMessageFormatter --property
> schema.registry.url=http://xxx:8088
>
> It is possible to send avro serialized data to kafka using
> kafka-console-producer.sh?
>
> Thanks,
> Lei
>
>
> wanglei2@geekplus.com.cn
>
>

Re: Is it possible to send avro serialized data to kafka using kafka-console-producer.sh

Posted by Miguel Silvestre <ms...@gmail.com>.
Hi,

check kafka-avro-console-producer

 ./bin/kafka-avro-console-producer \
         --broker-list localhost:9092 --topic test \
         --property
value.schema='{"type":"record","name":"myrecord","fields":[{"name":"f1","type":"string"}]}'

https://docs.confluent.io/3.0.0/quickstart.html

--
Miguel Silvestre


On Fri, May 8, 2020 at 10:53 AM wanglei2@geekplus.com.cn <
wanglei2@geekplus.com.cn> wrote:

>
> I can consume avro serialized data from kafka like this:
>
> bin/kafka-console-consumer.sh --bootstrap-server xxx:9092 --topic xxx
> --property print.key=true --formatter
> io.confluent.kafka.formatter.AvroMessageFormatter --property
> schema.registry.url=http://xxx:8088
>
> It is possible to send avro serialized data to kafka using
> kafka-console-producer.sh?
>
> Thanks,
> Lei
>
>
> wanglei2@geekplus.com.cn
>
>