Skip to content

ClassCastException in STOREAS PubSub mode when using JSON without schema #1700

@dilame

Description

@dilame

According to the official documentation for the Redis sink connector, No Schema and JSON payloads are supported:

However, when I use STOREAS PubSub with a JSON payload without schema (value.converter.schemas.enable=false), the connector crashes with the following error:

java.lang.ClassCastException: class java.util.HashMap cannot be cast to class org.apache.kafka.connect.data.Struct
	at io.lenses.streamreactor.connect.redis.sink.rowkeys.StringStructFieldsStringKeyBuilder.build(StringStructFieldsStringKeyBuilder.scala:52)

The KCQL I used:

SELECT * FROM outbox.event.asset.wallet.balance STOREAS PubSub(channel=account_id)

The same connector works fine with this configuration:

INSERT INTO students- SELECT * FROM outbox.event.asset.wallet.balance PK account_id

Environment:

Connector: kafka-connect-redis-assembly-9.0.0

Kafka Connect: 4.0.0

Redis Sink class: io.lenses.streamreactor.connect.redis.sink.RedisSinkConnector

value.converter: org.apache.kafka.connect.json.JsonConverter

value.converter.schemas.enable: false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions