You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/10/03 05:46:04 UTC

[GitHub] [pulsar] rocketraman commented on issue #3762: Shading Avro in pulsar-client

rocketraman commented on issue #3762: Shading Avro in pulsar-client
URL: https://github.com/apache/pulsar/issues/3762#issuecomment-537797198
 
 
   I'd like to at least have the option to use the Java Pulsar client with an unshaded Avro. We use Avro extensively with Kafka, and while we migrate to Pulsar, its imperative we have compatibility at the Avro message level, which means using the same version of Avro.
   
   Here is an issue we are running into because our messages use Avro 1.9.1 which supports the java.time APIs:
   
   ```
   java.lang.RuntimeException: java.lang.NoSuchMethodException: java.time.Instant.<init>()
   	at org.apache.pulsar.shade.org.apache.avro.specific.SpecificData.newInstance(SpecificData.java:353) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.shade.org.apache.avro.specific.SpecificData.newRecord(SpecificData.java:369) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectData.newRecord(ReflectData.java:901) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumReader.readRecord(GenericDatumReader.java:212) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumReader.readWithoutConversion(GenericDatumReader.java:175) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:153) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumReader.readWithoutConversion(GenericDatumReader.java:179) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectDatumReader.readField(ReflectDatumReader.java:302) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumReader.readRecord(GenericDatumReader.java:222) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumReader.readWithoutConversion(GenericDatumReader.java:175) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:153) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumReader.readWithoutConversion(GenericDatumReader.java:179) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectDatumReader.readField(ReflectDatumReader.java:302) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumReader.readRecord(GenericDatumReader.java:222) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumReader.readWithoutConversion(GenericDatumReader.java:175) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:153) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:145) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.client.impl.schema.reader.AvroReader.read(AvroReader.java:52) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.client.impl.schema.StructSchema.decode(StructSchema.java:94) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.client.impl.MessageImpl.getValue(MessageImpl.java:270) ~[pulsar-client-2.4.1.jar:2.4.1]
   	at org.apache.pulsar.client.impl.TopicMessageImpl.getValue(TopicMessageImpl.java:143) ~[pulsar-client-2.4.1.jar:2.4.1]
   	[...]
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services