Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Avro Schema has no support for Java Records. #23867

Open
2 of 3 tasks
anyuruf opened this issue Jan 18, 2025 · 3 comments
Open
2 of 3 tasks

[Bug] Avro Schema has no support for Java Records. #23867

anyuruf opened this issue Jan 18, 2025 · 3 comments
Labels
type/bug The PR fixed a bug or issue reported a bug

Comments

@anyuruf
Copy link

anyuruf commented Jan 18, 2025

Search before asking

  • I searched in the issues and found nothing similar.

Read release policy

  • I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

Version

Well not sure if I should call it a bug because. I guess it's not part of the spec. But sure would be a nice feature to have. When running the Java Pulsar client on Java 17, 21 and 23. I can produce messages with a Java Record class using the Schema.JSON method but Schema.AVRO is won't work.

 at org.apache.pulsar.shade.io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:405) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]
Caused by: java.lang.UnsupportedOperationException: can't get field offset on a record class: private final long net.anyuruf.order_producer.models.Order.createdAt
        at jdk.unsupported/sun.misc.Unsafe.objectFieldOffset(Unsafe.java:655) ~[na:na]
        at org.apache.pulsar.shade.org.apache.avro.reflect.FieldAccessUnsafe$UnsafeCachedField.<init>(FieldAccessUnsafe.java:81) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.reflect.FieldAccessUnsafe$UnsafeLongField.<init>(FieldAccessUnsafe.java:260) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.reflect.FieldAccessUnsafe.getAccessor(FieldAccessUnsafe.java:58) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectData$ClassAccessorData.<init>(ReflectData.java:372) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectData$ClassAccessorData.<init>(ReflectData.java:360) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectData$1.computeValue(ReflectData.java:354) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectData$1.computeValue(ReflectData.java:350) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at java.base/java.lang.ClassValue.getFromHashMap(ClassValue.java:229) ~[na:na]
        at java.base/java.lang.ClassValue.getFromBackup(ClassValue.java:211) ~[na:na]
        at java.base/java.lang.ClassValue.get(ClassValue.java:117) ~[na:na]
        at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectData.getClassAccessorData(ReflectData.java:411) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectData.getFieldAccessors(ReflectData.java:415) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectData.getRecordState(ReflectData.java:998) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:232) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.specific.SpecificDatumWriter.writeRecord(SpecificDatumWriter.java:92) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:145) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:95) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectDatumWriter.write(ReflectDatumWriter.java:158) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:82) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.client.impl.schema.writer.AvroWriter.write(AvroWriter.java:58) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        ... 53 common frames omitted

2025-01-18T12:33:33.932+03:00 ERROR 17032 --- [order_producer] [           main] reactor.core.publisher.Operators         : Operator called default onErrorDropped

reactor.core.Exceptions$ErrorCallbackNotImplemented: org.apache.pulsar.client.api.SchemaSerializationException: java.lang.UnsupportedOperationException: can't get field offset on a record class: private final long net.anyuruf.order_producer.models.Order.createdAt
Caused by: org.apache.pulsar.client.api.SchemaSerializationException: java.lang.UnsupportedOperationException: can't get field offset on a record class: private final long net.anyuruf.order_producer.models.Order.createdAt
        at org.apache.pulsar.client.impl.schema.writer.AvroWriter.write(AvroWriter.java:60) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.client.impl.schema.AbstractStructSchema.encode(AbstractStructSchema.java:61) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.client.impl.TypedMessageBuilderImpl.lambda$beforeSend$1(TypedMessageBuilderImpl.java:80) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at java.base/java.util.Optional.orElseGet(Optional.java:364) ~[na:na]
        at org.apache.pulsar.client.impl.TypedMessageBuilderImpl.beforeSend(TypedMessageBuilderImpl.java:79) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.client.impl.TypedMessageBuilderImpl.getMessage(TypedMessageBuilderImpl.java:271) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.client.impl.TypedMessageBuilderImpl.sendAsync(TypedMessageBuilderImpl.java:113) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.reactive.client.internal.adapter.AdaptedReactiveMessageSender.lambda$createMessageMono$5(AdaptedReactiveMessageSender.java:219) ~[pulsar-client-reactive-adapter-0.5.10.jar:na]
        at org.apache.pulsar.reactive.client.internal.adapter.PulsarFutureAdapter.createFuture(PulsarFutureAdapter.java:81) ~[pulsar-client-reactive-adapter-0.5.10.jar:na]
        at org.apache.pulsar.reactive.client.internal.adapter.PulsarFutureAdapter.lambda$toMono$1(PulsarFutureAdapter.java:76) ~[pulsar-client-reactive-adapter-0.5.10.jar:na]
        at reactor.core.publisher.Mono.lambda$fromFuture$1(Mono.java:686) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:45) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoUsingWhen$ResourceSubscriber.onNext(MonoUsingWhen.java:183) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:210) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondComplete(MonoFlatMap.java:245) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:305) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2571) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoFlatMap$FlatMapInner.onSubscribe(MonoFlatMap.java:291) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:55) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:165) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoCompletionStage$MonoCompletionStageSubscription.apply(MonoCompletionStage.java:121) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoCompletionStage$MonoCompletionStageSubscription.apply(MonoCompletionStage.java:67) ~[reactor-core-3.7.1.jar:3.7.1]
        at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.uniHandleStage(CompletableFuture.java:950) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.handle(CompletableFuture.java:2372) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.handle(CompletableFuture.java:144) ~[na:na]
        at reactor.core.publisher.MonoCompletionStage$MonoCompletionStageSubscription.request(MonoCompletionStage.java:145) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.FluxPeek$PeekSubscriber.request(FluxPeek.java:138) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoFlatMap$FlatMapMain.request(MonoFlatMap.java:194) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.request(FluxPeekFuseable.java:144) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoUsingWhen$ResourceSubscriber.onSubscribe(MonoUsingWhen.java:221) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onSubscribe(FluxPeekFuseable.java:178) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(MonoFlatMap.java:117) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.FluxPeek$PeekSubscriber.onSubscribe(FluxPeek.java:171) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoCompletionStage.subscribe(MonoCompletionStage.java:56) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4576) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoUsingWhen.subscribe(MonoUsingWhen.java:97) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4576) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:205) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoFlatMap.subscribeOrReturn(MonoFlatMap.java:53) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4560) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.Mono.subscribeWith(Mono.java:4642) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4403) ~[reactor-core-3.7.1.jar:3.7.1]
        at net.anyuruf.order_producer.OrderProducerApplication.UpLoadDataToPulsar(OrderProducerApplication.java:62) ~[classes/:na]
        at net.anyuruf.order_producer.OrderProducerApplication$ReactiveTemplateProducer.lambda$0(OrderProducerApplication.java:42) ~[classes/:na]
        at org.springframework.boot.SpringApplication.lambda$callRunner$4(SpringApplication.java:784) ~[spring-boot-3.4.1.jar:3.4.1]
        at org.springframework.util.function.ThrowingConsumer$1.acceptWithException(ThrowingConsumer.java:82) ~[spring-core-6.2.1.jar:6.2.1]
        at org.springframework.util.function.ThrowingConsumer.accept(ThrowingConsumer.java:60) ~[spring-core-6.2.1.jar:6.2.1]
        at org.springframework.util.function.ThrowingConsumer$1.accept(ThrowingConsumer.java:86) ~[spring-core-6.2.1.jar:6.2.1]
        at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:796) ~[spring-boot-3.4.1.jar:3.4.1]
        at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:784) ~[spring-boot-3.4.1.jar:3.4.1]
        at org.springframework.boot.SpringApplication.lambda$callRunners$3(SpringApplication.java:772) ~[spring-boot-3.4.1.jar:3.4.1]
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[na:na]
        at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357) ~[na:na]
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510) ~[na:na]
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[na:na]
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[na:na]
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[na:na]
        at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:772) ~[spring-boot-3.4.1.jar:3.4.1]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:325) ~[spring-boot-3.4.1.jar:3.4.1]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1361) ~[spring-boot-3.4.1.jar:3.4.1]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1350) ~[spring-boot-3.4.1.jar:3.4.1]
        at net.anyuruf.order_producer.OrderProducerApplication.main(OrderProducerApplication.java:23) ~[classes/:na]
Caused by: java.lang.UnsupportedOperationException: can't get field offset on a record class: private final long net.anyuruf.order_producer.models.Order.creat

I am not sure but I think Avro 1.12.0 has support for Java 17 and hence should be able to support Java Records

Minimal reproduce step

Pulsar version 4.0.1 Pulsar_Client with the same version and use Record classes instead of POJOs with the Schema.AVRO method. I have a Repo with spring-boot , pulsar reactive client and a docker-compose that would help reproduce the steps

What did you expect to see?

I expected to send pulsar messages to pulsar

What did you see instead?

 at org.apache.pulsar.shade.io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:405) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]
Caused by: java.lang.UnsupportedOperationException: can't get field offset on a record class: private final long net.anyuruf.order_producer.models.Order.createdAt
        at jdk.unsupported/sun.misc.Unsafe.objectFieldOffset(Unsafe.java:655) ~[na:na]
        at org.apache.pulsar.shade.org.apache.avro.reflect.FieldAccessUnsafe$UnsafeCachedField.<init>(FieldAccessUnsafe.java:81) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.reflect.FieldAccessUnsafe$UnsafeLongField.<init>(FieldAccessUnsafe.java:260) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.reflect.FieldAccessUnsafe.getAccessor(FieldAccessUnsafe.java:58) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectData$ClassAccessorData.<init>(ReflectData.java:372) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectData$ClassAccessorData.<init>(ReflectData.java:360) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectData$1.computeValue(ReflectData.java:354) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectData$1.computeValue(ReflectData.java:350) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at java.base/java.lang.ClassValue.getFromHashMap(ClassValue.java:229) ~[na:na]
        at java.base/java.lang.ClassValue.getFromBackup(ClassValue.java:211) ~[na:na]
        at java.base/java.lang.ClassValue.get(ClassValue.java:117) ~[na:na]
        at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectData.getClassAccessorData(ReflectData.java:411) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectData.getFieldAccessors(ReflectData.java:415) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectData.getRecordState(ReflectData.java:998) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:232) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.specific.SpecificDatumWriter.writeRecord(SpecificDatumWriter.java:92) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:145) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:95) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.reflect.ReflectDatumWriter.write(ReflectDatumWriter.java:158) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.shade.org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:82) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.client.impl.schema.writer.AvroWriter.write(AvroWriter.java:58) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        ... 53 common frames omitted

2025-01-18T12:33:33.932+03:00 ERROR 17032 --- [order_producer] [           main] reactor.core.publisher.Operators         : Operator called default onErrorDropped

reactor.core.Exceptions$ErrorCallbackNotImplemented: org.apache.pulsar.client.api.SchemaSerializationException: java.lang.UnsupportedOperationException: can't get field offset on a record class: private final long net.anyuruf.order_producer.models.Order.createdAt
Caused by: org.apache.pulsar.client.api.SchemaSerializationException: java.lang.UnsupportedOperationException: can't get field offset on a record class: private final long net.anyuruf.order_producer.models.Order.createdAt
        at org.apache.pulsar.client.impl.schema.writer.AvroWriter.write(AvroWriter.java:60) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.client.impl.schema.AbstractStructSchema.encode(AbstractStructSchema.java:61) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.client.impl.TypedMessageBuilderImpl.lambda$beforeSend$1(TypedMessageBuilderImpl.java:80) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at java.base/java.util.Optional.orElseGet(Optional.java:364) ~[na:na]
        at org.apache.pulsar.client.impl.TypedMessageBuilderImpl.beforeSend(TypedMessageBuilderImpl.java:79) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.client.impl.TypedMessageBuilderImpl.getMessage(TypedMessageBuilderImpl.java:271) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.client.impl.TypedMessageBuilderImpl.sendAsync(TypedMessageBuilderImpl.java:113) ~[pulsar-client-all-4.0.1.jar:4.0.1]
        at org.apache.pulsar.reactive.client.internal.adapter.AdaptedReactiveMessageSender.lambda$createMessageMono$5(AdaptedReactiveMessageSender.java:219) ~[pulsar-client-reactive-adapter-0.5.10.jar:na]
        at org.apache.pulsar.reactive.client.internal.adapter.PulsarFutureAdapter.createFuture(PulsarFutureAdapter.java:81) ~[pulsar-client-reactive-adapter-0.5.10.jar:na]
        at org.apache.pulsar.reactive.client.internal.adapter.PulsarFutureAdapter.lambda$toMono$1(PulsarFutureAdapter.java:76) ~[pulsar-client-reactive-adapter-0.5.10.jar:na]
        at reactor.core.publisher.Mono.lambda$fromFuture$1(Mono.java:686) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:45) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoUsingWhen$ResourceSubscriber.onNext(MonoUsingWhen.java:183) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:210) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondComplete(MonoFlatMap.java:245) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:305) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2571) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoFlatMap$FlatMapInner.onSubscribe(MonoFlatMap.java:291) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:55) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:165) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoCompletionStage$MonoCompletionStageSubscription.apply(MonoCompletionStage.java:121) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoCompletionStage$MonoCompletionStageSubscription.apply(MonoCompletionStage.java:67) ~[reactor-core-3.7.1.jar:3.7.1]
        at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.uniHandleStage(CompletableFuture.java:950) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.handle(CompletableFuture.java:2372) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.handle(CompletableFuture.java:144) ~[na:na]
        at reactor.core.publisher.MonoCompletionStage$MonoCompletionStageSubscription.request(MonoCompletionStage.java:145) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.FluxPeek$PeekSubscriber.request(FluxPeek.java:138) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoFlatMap$FlatMapMain.request(MonoFlatMap.java:194) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.request(FluxPeekFuseable.java:144) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoUsingWhen$ResourceSubscriber.onSubscribe(MonoUsingWhen.java:221) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onSubscribe(FluxPeekFuseable.java:178) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(MonoFlatMap.java:117) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.FluxPeek$PeekSubscriber.onSubscribe(FluxPeek.java:171) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoCompletionStage.subscribe(MonoCompletionStage.java:56) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4576) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoUsingWhen.subscribe(MonoUsingWhen.java:97) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4576) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:205) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.MonoFlatMap.subscribeOrReturn(MonoFlatMap.java:53) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4560) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.Mono.subscribeWith(Mono.java:4642) ~[reactor-core-3.7.1.jar:3.7.1]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4403) ~[reactor-core-3.7.1.jar:3.7.1]
        at net.anyuruf.order_producer.OrderProducerApplication.UpLoadDataToPulsar(OrderProducerApplication.java:62) ~[classes/:na]
        at net.anyuruf.order_producer.OrderProducerApplication$ReactiveTemplateProducer.lambda$0(OrderProducerApplication.java:42) ~[classes/:na]
        at org.springframework.boot.SpringApplication.lambda$callRunner$4(SpringApplication.java:784) ~[spring-boot-3.4.1.jar:3.4.1]
        at org.springframework.util.function.ThrowingConsumer$1.acceptWithException(ThrowingConsumer.java:82) ~[spring-core-6.2.1.jar:6.2.1]
        at org.springframework.util.function.ThrowingConsumer.accept(ThrowingConsumer.java:60) ~[spring-core-6.2.1.jar:6.2.1]
        at org.springframework.util.function.ThrowingConsumer$1.accept(ThrowingConsumer.java:86) ~[spring-core-6.2.1.jar:6.2.1]
        at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:796) ~[spring-boot-3.4.1.jar:3.4.1]
        at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:784) ~[spring-boot-3.4.1.jar:3.4.1]
        at org.springframework.boot.SpringApplication.lambda$callRunners$3(SpringApplication.java:772) ~[spring-boot-3.4.1.jar:3.4.1]
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[na:na]
        at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357) ~[na:na]
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510) ~[na:na]
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[na:na]
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[na:na]
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[na:na]
        at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:772) ~[spring-boot-3.4.1.jar:3.4.1]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:325) ~[spring-boot-3.4.1.jar:3.4.1]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1361) ~[spring-boot-3.4.1.jar:3.4.1]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1350) ~[spring-boot-3.4.1.jar:3.4.1]
        at net.anyuruf.order_producer.OrderProducerApplication.main(OrderProducerApplication.java:23) ~[classes/:na]
Caused by: java.lang.UnsupportedOperationException: can't get field offset on a record class: private final long net.anyuruf.order_producer.models.Order.creat

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@anyuruf anyuruf added the type/bug The PR fixed a bug or issue reported a bug label Jan 18, 2025
@anyuruf
Copy link
Author

anyuruf commented Jan 18, 2025

This Issue kinda points to version 1.12.0 as having support for records apache/avro#1680

@visxu
Copy link
Contributor

visxu commented Jan 20, 2025

Hi, @anyuruf. Could you please share the repo with helping reproduce issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

No branches or pull requests

2 participants