I am sending a command C1 which is applying event E1 on an aggregate.
This event E1 starts a new saga.
Inside this event E1 i am sending another command which is publishing second event E2 on the event bus.
The second event E2’s saga handler is not getting called.
When i debugged i could see for the second event E2 there is no saga stored in the database when invokeExistingSaga-> jpaSagaRepository->findAssociatedSagaIdentifiers() is called.
Is there any way i can commit the new created saga before the second event E2 checks for existing saga?
I tried with axon 2.0.6 and still facing the same issue.
Although i am getting the sagaId from sagaInCreation map, when the loadAndInvoke() is called and we are trying to load the newly created saga from the jpaSagaRepository the serializedSagaList is coming as empty and we return null.
let me guess: you use the SimpleCommandBus and SimpleEventBus? Seems that my fix for AON-188 only works when the second event is handled by a different thread… I will look into this.