Hi,
I’m working with Axon 1.2 in a simple PoC including SAGA’s and Quartz.
The integration and the firing of events works just about fine. As you can see in the logs below, after the Scheduled job triggers all steps in handling the event get completed successfully.
The problem I’m experiencing is that when handling the event I want a change of state in an associated aggregate of the SAGA.
My aggregate apply()'s to a new event, it handles it correctly but the Event is never stored.
DEBUG - JobRunShell - Calling execute on job AxonFramework-Events.event-6060a1e0-fbf5-426b-b75b-0b262b51e040
DEBUG - FireEventJob - Starting job to publish a scheduled event
DEBUG - SimpleEventBus - Dispatching Event [IdentifiableScheduleEvent] to EventListener [AnnotationEventListenerAdapter]
DEBUG - ynchronousExecutionWrapper - Scheduling task of type [IdentifiableScheduleEvent] for full concurrent processing
DEBUG - SimpleEventBus - Dispatching Event [IdentifiableScheduleEvent] to EventListener [AnnotatedSagaManager]
DEBUG - SolicitudDeAmbulanciaSAGA - SAGA TIMED OUT - Token: Quartz Schedule token for job [event-6060a1e0-fbf5-426b-b75b-0b262b51e040] in group [AxonFramework-Events] ScheduledTime: 2011-11-14T09:26:10.034-03:00
DEBUG - Solicitud - Handling event ar.com.fluxit.osde.command.events.SolicitudChangedStateEvent@3dfabb76
DEBUG - AbstractUnitOfWork - Starting Unit Of Work.
DEBUG - AbstractUnitOfWork - Registering Unit Of Work as CurrentUnitOfWork
DEBUG - AbstractUnitOfWork - Committing Unit Of Work
DEBUG - DefaultUnitOfWork - Notifying listeners of commit request
DEBUG - DefaultUnitOfWork - Listeners successfully notified
DEBUG - DefaultUnitOfWork - Persisting changes to aggregates
DEBUG - DefaultUnitOfWork - Aggregates successfully persisted
DEBUG - AbstractUnitOfWork - This Unit Of Work is not nested. Finalizing commit…
DEBUG - DefaultUnitOfWork - Publishing events to the event bus
DEBUG - DefaultUnitOfWork - All events successfully published.
DEBUG - DefaultUnitOfWork - Notifying listeners after commit
DEBUG - AbstractUnitOfWork - Stopping Unit Of Work
DEBUG - DefaultUnitOfWork - Notifying listeners of cleanup
DEBUG - DefaultUnitOfWork - Listeners successfully notified
DEBUG - AbstractUnitOfWork - Clearing resources of this Unit Of Work.
INFO - FireEventJob - Job successfully executed. Scheduled Event has been published.
Find here the key pieces of code of my application
SolicitudDeAmbulanciaSAGA
private Solicitud solicitud;
…
@SagaEventHandler(associationProperty = “solicitudID”)
public void handle(IdentifiableScheduleEvent event) {
LOG.debug("SAGA TIMED OUT - Token: " + this.getScheduleToken() + " ScheduledTime: " + event.getScheduledTime());
if (this.isActive()) {
getSolicitud().anularPorTimeOut();
…
Solicitud
public void anularPorTimeOut() {
apply(new SolicitudChangedStateEvent()…
@EventHandler
protected void handle(SolicitudChangedStateEvent event) {
LOG.debug("Handling event " + event);
this.setState(event.getNewState());
}
I apologize for the lengthy email, I’m publishing this problem in the group as a last resource.
I think there’s nothing strange in the example, so my next steps will be to debug and check if the SAGA can keep an Aggregate instance as part of its state.
Thank you in advance,
Fer.-