eventuate-tram/eventuate-tram-sagas

java.lang.RuntimeException: No method for io.eventuate.tram.messaging.common.MessageImpl@5ae52f04

kumar-csice opened this issue · 5 comments

@cer

I have created all the eventuate framework tables and order and also customer micro service specific tables in the same customer_order_service's eventuate schema.

image

On http://localhost:8082/api/orders POST call getting below error in customer-service micro service.

image

java.lang.RuntimeException: No method for io.eventuate.tram.messaging.common.MessageImpl@5ae52f04[payload={"orderId":2,"orderTotal":{"amount":210.0},"customerId":2},headers={command_saga_id=00000186da5861a3-0000000000e00000, PARTITION_ID=849aa8cc-12b3-45b6-9a54-85611a3fdc44, DATE=Mon, 13 Mar 2023 09:41:26 GMT, command_type=com.mt.unity.orderservice.saga.apimessaging.command.ReserveCreditCommand, command_reply_to=com.mt.unity.orderservice.saga.CreateOrderSaga-reply, DESTINATION=customerService, command_saga_type=com.mt.unity.orderservice.saga.CreateOrderSaga, command__destination=customerService, ID=00000186da58a0af-0000000000e00000}]
	at io.eventuate.tram.commands.consumer.CommandDispatcher.messageHandler(CommandDispatcher.java:61) ~[eventuate-tram-commands-0.31.0.RELEASE.jar:na]
	at io.eventuate.tram.sagas.participant.SagaCommandDispatcher.messageHandler(SagaCommandDispatcher.java:38) ~[eventuate-tram-sagas-participant-0.20.0.RELEASE.jar:na]
	at io.eventuate.tram.consumer.common.DecoratedMessageHandlerFactory.lambda$decorate$0(DecoratedMessageHandlerFactory.java:34) ~[eventuate-tram-consumer-common-0.31.0.RELEASE.jar:na]
	at io.eventuate.tram.consumer.common.PrePostHandlerMessageHandlerDecorator.accept(PrePostHandlerMessageHandlerDecorator.java:27) ~[eventuate-tram-consumer-common-0.31.0.RELEASE.jar:na]
	at io.eventuate.tram.consumer.common.PrePostHandlerMessageHandlerDecorator.accept(PrePostHandlerMessageHandlerDecorator.java:12) ~[eventuate-tram-consumer-common-0.31.0.RELEASE.jar:na]
	at io.eventuate.tram.consumer.common.MessageHandlerDecoratorChainBuilder.lambda$buildChain$0(MessageHandlerDecoratorChainBuilder.java:33) ~[eventuate-tram-consumer-common-0.31.0.RELEASE.jar:na]
	at io.eventuate.tram.consumer.common.DuplicateDetectingMessageHandlerDecorator.lambda$accept$0(DuplicateDetectingMessageHandlerDecorator.java:16) ~[eventuate-tram-consumer-common-0.31.0.RELEASE.jar:na]
	at io.eventuate.tram.consumer.jdbc.TransactionalNoopDuplicateMessageDetector.lambda$doWithMessage$0(TransactionalNoopDuplicateMessageDetector.java:28) ~[eventuate-tram-consumer-jdbc-0.31.0.RELEASE.jar:na]
	at io.eventuate.common.spring.jdbc.EventuateSpringTransactionTemplate.lambda$executeInTransaction$0(EventuateSpringTransactionTemplate.java:18) ~[eventuate-common-spring-jdbc-0.16.0.RELEASE.jar:na]
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-6.0.6.jar:6.0.6]
	at io.eventuate.common.spring.jdbc.EventuateSpringTransactionTemplate.executeInTransaction(EventuateSpringTransactionTemplate.java:18) ~[eventuate-common-spring-jdbc-0.16.0.RELEASE.jar:na]
	at io.eventuate.tram.consumer.jdbc.TransactionalNoopDuplicateMessageDetector.doWithMessage(TransactionalNoopDuplicateMessageDetector.java:26) ~[eventuate-tram-consumer-jdbc-0.31.0.RELEASE.jar:na]
	at io.eventuate.tram.consumer.common.DuplicateDetectingMessageHandlerDecorator.accept(DuplicateDetectingMessageHandlerDecorator.java:16) ~[eventuate-tram-consumer-common-0.31.0.RELEASE.jar:na]
	at io.eventuate.tram.consumer.common.DuplicateDetectingMessageHandlerDecorator.accept(DuplicateDetectingMessageHandlerDecorator.java:6) ~[eventuate-tram-consumer-common-0.31.0.RELEASE.jar:na]
	at io.eventuate.tram.consumer.common.MessageHandlerDecoratorChainBuilder.lambda$buildChain$0(MessageHandlerDecoratorChainBuilder.java:33) ~[eventuate-tram-consumer-common-0.31.0.RELEASE.jar:na]
	at io.eventuate.tram.consumer.common.PrePostReceiveMessageHandlerDecorator.accept(PrePostReceiveMessageHandlerDecorator.java:26) ~[eventuate-tram-consumer-common-0.31.0.RELEASE.jar:na]
	at io.eventuate.tram.consumer.common.PrePostReceiveMessageHandlerDecorator.accept(PrePostReceiveMessageHandlerDecorator.java:12) ~[eventuate-tram-consumer-common-0.31.0.RELEASE.jar:na]
	at io.eventuate.tram.consumer.common.MessageHandlerDecoratorChainBuilder.lambda$buildChain$0(MessageHandlerDecoratorChainBuilder.java:33) ~[eventuate-tram-consumer-common-0.31.0.RELEASE.jar:na]
	at io.eventuate.tram.consumer.common.MessageConsumerImpl.lambda$subscribe$0(MessageConsumerImpl.java:40) ~[eventuate-tram-consumer-common-0.31.0.RELEASE.jar:na]
	at io.eventuate.tram.consumer.kafka.EventuateTramKafkaMessageConsumer.lambda$subscribe$0(EventuateTramKafkaMessageConsumer.java:29) ~[eventuate-tram-consumer-kafka-0.31.0.RELEASE.jar:na]
	at io.eventuate.messaging.kafka.consumer.MessageConsumerKafkaImpl.lambda$subscribe$0(MessageConsumerKafkaImpl.java:46) ~[eventuate-messaging-kafka-consumer-0.16.0.RELEASE.jar:na]
	at io.eventuate.messaging.kafka.consumer.MessageConsumerKafkaImpl.handle(MessageConsumerKafkaImpl.java:99) ~[eventuate-messaging-kafka-consumer-0.16.0.RELEASE.jar:na]
	at io.eventuate.messaging.kafka.consumer.MessageConsumerKafkaImpl.lambda$subscribeWithReactiveHandler$1(MessageConsumerKafkaImpl.java:59) ~[eventuate-messaging-kafka-consumer-0.16.0.RELEASE.jar:na]
	at io.eventuate.messaging.kafka.consumer.SwimlaneDispatcher.processQueuedMessage(SwimlaneDispatcher.java:72) ~[eventuate-messaging-kafka-consumer-0.16.0.RELEASE.jar:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
	at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]

@cer
The issue is due to ReserveCreditCommand as instead of common service, I have created it in both services with different packages as shown below

Customer-service
com.mt.unity.customerservice.apimessaging.command.ReserveCreditCommand

order-service
com.mt.unity.orderservice.saga.apimessaging.command.ReserveCreditCommand

cer commented

The issue is due to ReserveCreditCommand as instead of common service, I have created it in both services with different packages as shown below

Yes. The fully qualified class names need to match.
Glad you have made progress though.

cer commented

I have created all the eventuate framework tables and order and also customer micro service specific tables in the same customer_order_service's eventuate schema.

I'm confused about your database architecture. Do the Customer Service and Order Service share the same Postgres server?

Here Yes..I am very anxious to see SAGA txn flow
So in another workspace I have tried with same DB with same schema for both order and customer microservice. Atleast now I able to see the next step in your SAGA framework.

But unfortunately with different DB for each microservice ( and with public schema) it is not at all working though I created all the orchestrator and participants in both the DB. Because eventuate framework always expects eventuate.saga_instance table under eventuate schema.
It looks like framework is tightly coupled with eventuate schema

cer commented

But unfortunately with different DB for each microservice ( and with public schema) it is not at all working though I created all the orchestrator and participants in both the DB.

See #95 (comment)