Arkadiusz Gasinski created BEAM-13526:
-----------------------------------------
Summary: Unable to use the
KafkaIO.Read.withValueDeserializer(DeserializerProvider) method
Key: BEAM-13526
URL: https://issues.apache.org/jira/browse/BEAM-13526
Project: Beam
Issue Type: Bug
Components: io-java-kafka
Affects Versions: 2.34.0
Reporter: Arkadiusz Gasinski
I'm trying to configure my pipeline to read AVRO-encoded messages from Kafka
with deserialization delegated to the
ConfluentSchemaRegistryDeserialzerProvider, and I'm getting the following error:
Exception in thread "main" java.lang.IllegalAccessError: failed to access class
org.apache.beam.sdk.io.kafka.DeserializerProvider from class MyClass (both are
in unnamed module of loader 'app')
The way I configure the KafkaIO.Read is like:
{code:java}
KafkaIO.read<String, GenericRecord>()
.withBootstrapServers(...)
.withKeyDeserializer(StringDeserializer::class.java)
.withValueDeserializer(ConfluentSchemaRegistryDeserializerProvider.of<GenericRecord>(...)
.withTopic(...)
...{code}
I checked the DeserializerProvider interface and it's package private - it's
not even listed in the official java docs for Beam
(https://beam.apache.org/releases/javadoc/2.34.0/org/apache/beam/sdk/io/kafka/package-summary.html);
the ConfluentSchemaRegistryDeserialzerProvider is public.
Am I the only one trying to use this API, or am I doing sth terribly wrong?
--
This message was sent by Atlassian Jira
(v8.20.1#820001)