Hi,
I’m facing issues related to Saga configuration with clustered-event bus (with amqp-rabbit).
Issue 1:
Any SagaEventHandler configured after the first type (in this case com.test.EventHandler1) is not consuming the events.They are remaining in the rabbit-queues with status ‘ready’.
If i switch com.test.EventHandler2 with com.test.EventHandler1 then com.test.EventHandler2 gets triggered.
Not sure if there is any mistake in the below configuration.
Spring-config below
`
<axon:saga-manager id=“sagaManager” event-bus=“eventBus” saga-repository=“sagaMongoRepository”>
<axon:async transaction-manager=“transactionManager”/>
axon:types
com.test.EventHandler1,
com.test.EventHandler2
</axon:types>
</axon:saga-manager>
`
EventHandlers
`
package com.test
@Component
public class EventHandler1 extends AbstractAnnotatedSaga {
@StartSaga
@SagaEventHandler(associationProperty = “sagaIdentifier”)
@Transactional
public void handleEvent1(Event event, @Timestamp DateTime time) { …}
}
package com.test
@Component
public class EventHandler2 extends AbstractAnnotatedSaga {
@StartSaga
@SagaEventHandler(associationProperty = “sagaIdentifier”)
@Transactional
public void handleEvent2(Event event, @Timestamp DateTime time) { …}
}
`
Issue2:
The eventlistener is throwing below exception when persisting the saga in MongoDB.
`
[WARN] org.axonframework.saga.annotation.AsyncAnnotatedSagaManager$LoggingExceptionHandler - A fatal exception occurred while processing an Event for a Saga. Processing will continue with the next Event
org.axonframework.serializer.SerializationException: An exception occurred writing serialized data to the output stream
at org.axonframework.serializer.JavaSerializer.serialize(JavaSerializer.java:72) ~[axon-core-2.3.2.jar:2.3.2]
at org.axonframework.saga.repository.mongo.SagaEntry.(SagaEntry.java:65) ~[axon-mongo-2.3.2.jar:2.3.2]
at org.axonframework.saga.repository.mongo.MongoSagaRepository.storeSaga(MongoSagaRepository.java:117) ~[axon-mongo-2.3.2.jar:2.3.2]
at org.axonframework.saga.repository.AbstractSagaRepository.add(AbstractSagaRepository.java:51) ~[axon-core-2.3.2.jar:2.3.2]
at org.axonframework.saga.annotation.AsyncSagaEventProcessor.persistProcessedSagas(AsyncSagaEventProcessor.java:219) ~[axon-core-2.3.2.jar:2.3.2]
at org.axonframework.saga.annotation.AsyncSagaEventProcessor.doProcessEvent(AsyncSagaEventProcessor.java:147) ~[axon-core-2.3.2.jar:2.3.2]
at org.axonframework.saga.annotation.AsyncSagaEventProcessor.onEvent(AsyncSagaEventProcessor.java:118) ~[axon-core-2.3.2.jar:2.3.2]
at org.axonframework.saga.annotation.AsyncSagaEventProcessor.onEvent(AsyncSagaEventProcessor.java:49) ~[axon-core-2.3.2.jar:2.3.2]
at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:133) ~[disruptor-3.2.0.jar:na]
at org.axonframework.saga.annotation.AsyncAnnotatedSagaManager$StartDetectingRunnable.run(AsyncAnnotatedSagaManager.java:481) [axon-core-2.3.2.jar:2.3.2]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_25]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_25]
Caused by: java.io.NotSerializableException: org.axonframework.eventhandling.ClusteringEventBus
`
Let me know if you need more information.
Thanks,
Jebu.