holixon / axon-avro

An ecosystem for using Apache Avro as serialization format for Axon messages
Apache License 2.0
6 stars 0 forks source link

[BLOCKER] Error serializing... #105

Closed zambrovski closed 3 months ago

zambrovski commented 4 months ago

Both EventSerializer and MessageSerializer are set to AvroSerializer.

For example if we run AxonAvroSerializerConfigurationITest (mvn -Pitest) it will fail with...

20:54:29.006 WARN  org.axonframework.axonserver.connector.command.CommandSerializer - Serializing exception [class org.axonframework.serialization.CannotConvertBetweenTypesException] without details.
org.axonframework.serialization.CannotConvertBetweenTypesException: Cannot build a converter to convert from org.apache.avro.generic.GenericData$Record to [B
    at org.axonframework.serialization.ChainedConverter.calculateChain(ChainedConverter.java:59)
    at org.axonframework.serialization.ChainingConverter.convert(ChainingConverter.java:95)
    at org.axonframework.serialization.Converter.convert(Converter.java:44)
    at io.holixon.axon.avro.serializer.AvroSerializer.serialize(AvroSerializer.kt:152)
    at org.axonframework.axonserver.connector.event.axon.GrpcMetaDataAwareSerializer.serialize(GrpcMetaDataAwareSerializer.java:52)
    at org.axonframework.serialization.SerializedObjectHolder.serializePayload(SerializedObjectHolder.java:57)
    at org.axonframework.messaging.GenericMessage.serializePayload(GenericMessage.java:167)
    at org.axonframework.messaging.MessageDecorator.serializePayload(MessageDecorator.java:66)
    at org.axonframework.axonserver.connector.event.axon.AxonServerEventStore$AxonIQEventStorageEngine.map(AxonServerEventStore.java:502)
    at org.axonframework.axonserver.connector.event.axon.AxonServerEventStore$AxonIQEventStorageEngine.appendEvents(AxonServerEventStore.java:472)
    at org.axonframework.eventsourcing.eventstore.AbstractEventStorageEngine.appendEvents(AbstractEventStorageEngine.java:105)
    at org.axonframework.eventsourcing.eventstore.AbstractEventStore.prepareCommit(AbstractEventStore.java:66)
    at org.axonframework.eventhandling.AbstractEventBus.doWithEvents(AbstractEventBus.java:256)
    at org.axonframework.eventhandling.AbstractEventBus.lambda$null$11(AbstractEventBus.java:170)
    at org.axonframework.messaging.unitofwork.MessageProcessingContext.notifyHandlers(MessageProcessingContext.java:72)
    at org.axonframework.messaging.unitofwork.DefaultUnitOfWork.notifyHandlers(DefaultUnitOfWork.java:109)
    at org.axonframework.messaging.unitofwork.AbstractUnitOfWork.changePhase(AbstractUnitOfWork.java:236)
    at org.axonframework.messaging.unitofwork.AbstractUnitOfWork.commitAsRoot(AbstractUnitOfWork.java:87)
    at org.axonframework.messaging.unitofwork.AbstractUnitOfWork.commit(AbstractUnitOfWork.java:75)
    at org.axonframework.messaging.unitofwork.DefaultUnitOfWork.executeWithResult(DefaultUnitOfWork.java:95)
    at org.axonframework.commandhandling.SimpleCommandBus.lambda$handle$2(SimpleCommandBus.java:200)
    at org.axonframework.tracing.Span.runSupplier(Span.java:163)
    at org.axonframework.commandhandling.SimpleCommandBus.handle(SimpleCommandBus.java:191)
    at org.axonframework.commandhandling.SimpleCommandBus.doDispatch(SimpleCommandBus.java:165)
    at org.axonframework.commandhandling.SimpleCommandBus.lambda$dispatch$1(SimpleCommandBus.java:131)
    at org.axonframework.tracing.Span.run(Span.java:101)
    at org.axonframework.commandhandling.SimpleCommandBus.dispatch(SimpleCommandBus.java:125)
    at org.axonframework.axonserver.connector.command.AxonServerCommandBus$CommandProcessingTask.lambda$run$1(AxonServerCommandBus.java:311)
    at org.axonframework.tracing.Span.run(Span.java:101)
    at org.axonframework.axonserver.connector.command.AxonServerCommandBus$CommandProcessingTask.run(AxonServerCommandBus.java:309)
    at org.axonframework.axonserver.connector.PriorityRunnable.run(PriorityRunnable.java:58)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:840)
20:54:29.008 INFO  org.axonframework.axonserver.connector.command.CommandSerializer - To share exceptional information with the recipient it is recommended to wrap the exception in a CommandExecutionException with provided details.

org.axonframework.commandhandling.CommandExecutionException: Cannot build a converter to convert from org.apache.avro.generic.GenericData$Record to [B

Caused by: AxonServerNonTransientRemoteCommandHandlingException{message=An exception was thrown by the remote message handling component: Cannot build a converter to convert from org.apache.avro.generic.GenericData$Record to [B, errorCode='AXONIQ-4005', server='667343@blackstar'}
    at org.axonframework.axonserver.connector.ErrorCode.lambda$static$14(ErrorCode.java:107)
    at org.axonframework.axonserver.connector.ErrorCode.convert(ErrorCode.java:201)
    at org.axonframework.axonserver.connector.command.CommandSerializer.deserialize(CommandSerializer.java:176)
    at org.axonframework.axonserver.connector.command.AxonServerCommandBus.lambda$doDispatch$1(AxonServerCommandBus.java:184)
    at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
    at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
    at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
    at io.axoniq.axonserver.connector.command.impl.CommandChannelImpl$CommandResponseHandler.onNext(CommandChannelImpl.java:386)
    at io.axoniq.axonserver.connector.command.impl.CommandChannelImpl$CommandResponseHandler.onNext(CommandChannelImpl.java:373)
    at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onMessage(ClientCalls.java:468)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInternal(ClientCallImpl.java:667)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInContext(ClientCallImpl.java:654)
    at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
    at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:840)
zambrovski commented 4 months ago

The converter was indeed missing (as we changed from GenericData.Record to GenericRecord.