w4rdy opened a new issue, #1487:
URL: https://github.com/apache/camel-kafka-connector/issues/1487
Hello,
I'm trying to get the Cassandra sink connector to work with a JSON string
produced to a Kafka topic. I've managed to get the connector to add rows to my
table when producing the Kafka message:
```
["1","John",1670428382089]
```
But would instead like to produce messages on to the topic in the following
format:
```
{
"id" : "1",
"name" : "John",
"created_at" : 1670428382089
}
```
I've attempted to use
`value.converter=org.apache.kafka.connect.json.JsonConverter` in my sink
properties, but receive the exception: `NoTypeConversionAvailableException: No
type converter available to convert from type: java.util.HashMap to the
required type: java.io.InputStream`.
Is it possible to achieve this with the Camel Cassandra sink connector?
___
Cassandra table:
```cql
USE connect;
CREATE TABLE person (
id TEXT PRIMARY KEY,
name TEXT,
created_at TIMESTAMP
);
```
Sink properties:
```properties
name=person-cassandra-sink-connector
topics=person
tasks.max=1
connector.class=org.apache.camel.kafkaconnector.cassandrasink.CamelCassandrasinkSinkConnector
value.converter=org.apache.kafka.connect.storage.StringConverter
camel.kamelet.cassandra-sink.connectionHost=cassandra
camel.kamelet.cassandra-sink.connectionPort=9042
camel.kamelet.cassandra-sink.keyspace=connect
camel.kamelet.cassandra-sink.query=insert into person(id, name, created_at)
values (?, ?, ?)
camel.kamelet.cassandra-sink.prepareStatements=false
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]