# How to post messages to kafka cassandra sink

**URL:** <https://forum.confluent.io/t/how-to-post-messages-to-kafka-cassandra-sink/4785>\
**Category:** Kafka Connect\
**Created:** [16 April 2022 17:14 UTC](https://forum.confluent.io/t/how-to-post-messages-to-kafka-cassandra-sink/4785 "2022-04-16T17:14:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kkhambadkone](https://avatars.discourse-cdn.com/v4/letter/k/96bed5/32.png) [@kkhambadkone](https://forum.confluent.io/u/kkhambadkone)\
**Post date:** [16 April 2022 17:14 UTC](https://forum.confluent.io/t/how-to-post-messages-to-kafka-cassandra-sink/4785/1 "2022-04-16T17:14:38Z")

</div>

Hi, I am trying to post this message to a topic on which a kafka cassandra sink connector is listening. What am I doing wrong here. It is throwing this error message

```auto
confluent-6.1.1/bin/kafka-avro-console-producer --broker-list localhost:9092 --topic cassandra-sink-topic --property value.schema=’{“type”:“record”,“name”:“myrecord”,“fields”:[{“name”:“language”,“type”:“string”},{“name”:“users_count”,“type”:“string”}]}’

{“language”:“LISP”,“users_count”:“4000”}

org.apache.kafka.common.errors.SerializationException: Error registering Avro schema{“type”:“record”,“name”:“myrecord”,“fields”:[{“name”:“language”,“type”:“string”},{“name”:“users_count”,“type”:“string”}]}

Caused by: io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Unexpected character (’<’ (code 60)): expected a valid value (JSON String, Number, Array, Object or token ‘null’, ‘true’ or ‘false’)

at [Source: (sun.net.www.protocol.http.HttpURLConnection$HttpInputStream); line: 1, column: 2]; error code: 50005

at io.confluent.kafka.schemaregistry.client.rest.RestService.sendHttpRequest(RestService.java:295)

at io.confluent.kafka.schemaregistry.client.rest.RestService.httpRequest(RestService.java:355)

at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:498)

at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:489)

at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:462)

at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.registerAndGetId(CachedSchemaRegistryClient.java:214)

at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.register(CachedSchemaRegistryClient.java:276)

at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.register(CachedSchemaRegistryClient.java:252)

at io.confluent.kafka.serializers.AbstractKafkaAvroSerializer.serializeImpl(AbstractKafkaAvroSerializer.java:84)

at io.confluent.kafka.formatter.AvroMessageReader$AvroMessageSerializer.serialize(AvroMessageReader.java:168)

at io.confluent.kafka.formatter.SchemaMessageReader.readMessage(SchemaMessageReader.java:317)

at kafka.tools.ConsoleProducer$.main(ConsoleProducer.scala:51)

at kafka.tools.ConsoleProducer.main(ConsoleProducer.scala

```

---

<div class="post-metadata">

**Author:** ![kkhambadkone](https://avatars.discourse-cdn.com/v4/letter/k/96bed5/32.png) [@kkhambadkone](https://forum.confluent.io/u/kkhambadkone)\
**Post date:** [17 April 2022 16:53 UTC](https://forum.confluent.io/t/how-to-post-messages-to-kafka-cassandra-sink/4785/2 "2022-04-17T16:53:48Z")

</div>

Issue resolved when I specified it like this

```auto
confluent-6.1.1/bin/kafka-avro-console-producer --broker-list localhost:9092 --topic cassandra-sink-topic --property "parse.key=true" --property "key.separator=|" --property key.schema='{"name":"key","type":"string"}' --property value.schema='{"type":"record","name":"myrecord","fields":[{"name":"language","type":"string"},{"name":"users_count","type":"string"}]}'**

“B"|{"language":"LISP","users_count":"4000"}**

```

---

<div class="post-metadata">

**Author:** ![vnadkarni](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/vnadkarni/32/1839_2.png) [@vnadkarni](https://forum.confluent.io/u/vnadkarni)\
**Post date:** [19 April 2022 12:58 UTC](https://forum.confluent.io/t/how-to-post-messages-to-kafka-cassandra-sink/4785/3 "2022-04-19T12:58:42Z")

</div>

@kkhambadkone, Glad you were able to resolve it over the weekend 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/confluentcommunity/original/1X/c49438c90c9df282e9996fdf6971be890c71b65a.svg) [@system](https://forum.confluent.io/u/system)\
**Post date:** [19 May 2022 12:58 UTC](https://forum.confluent.io/t/how-to-post-messages-to-kafka-cassandra-sink/4785/4 "2022-05-19T12:58:57Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
