A.1.2 Troubleshooting Steps
-
Java code enters the
@LRAannotated methodbooking()of theTravelAgencyControllerclass.A query on
DBA_SAGASon theTravelAgency’sPDB (Travel PDB) shows the following state:Travel PDB:
SELECT id, initiator, coordinator, status FROM dba_sagas;id initiator coordinator status abc123
TravelAgency
TACoordinator
Initiated
At this point, no participants have been enrolled. The Saga identifier ‘abc123’ has been assigned for the newly created Saga.
-
This step corresponds to the participant
Airlineformally joining the Saga by sending an ACK to the Saga coordinator. This is handled by the Saga framework and is initiated by the join message from the Saga initiator. The Saga initiator invokes thesendRequest()call as shown in the following code segment:saga.sendRequest ("Airline", bookingPayload);The ACK is recorded at both the coordinator and participant PDBs. The following steps: 3 and 4, represent the chronological order of operations, as shown through the Saga dictionary views on the respective PDBs.
Airline PDB (ACK initiated)
SELECT id, participant, initiator, status FROM dba_sagas WHERE id='abc123';id participant initiator status abc123
Airline
TravelAgency
Joining
-
The travel coordinator (
TACoordinator) receives the asynchronous ACK message and responds by adding the participant (Airline) to the participant set for the given Saga and sending a message in response.Travel Coordinator PDB (ACK received):
SELECT id, participant, status FROM dba_saga_participant_set WHERE id='abc123';id participant status abc123TravelAgencyJoined -
The
Airlinereceives the ACK message from the Saga coordinator and initiates the processing of the Saga payload using its@Requestannotated method:handleTravelAgencyRequest().Airline PDB (ACK complete):
SELECT id, participant, initiator, status FROM dba_sagas WHERE id='abc123';id participant initiator status abc123AirlineTravelAgencyJoinedThe process of join acknowledgment is conducted using AQ messaging, propagation, and notification. The join message is enqueued at the source OUT queue (
SAGA$_AIRLINE_OUT_Q1in our example) and propagated to the Saga coordinator’s IN queue (SAGA$_TACOORDINATOR_IN_Q1) by the way of the message broker. -
Upon receiving a response from
Airline, the initiator (TravelAgency) finalizes (commits) the Saga. The finalization process involves the following state transitions.Travel PDB:
SELECT id, initiator, coordinator, status FROM dba_sagas WHERE id='abc123';id initiator coordinator status abc123TravelAgencyTACoordinatorCommitted -
The
Airlinereceives the commit message and initiates its own commit action. This results in the Saga transitioning fromJoinedtoCommittedon the participant PDB. TheAirlinesends a message to the coordinator indicating the status of its commit.Airline PDB:
SELECT id, participant, initiator, status FROM dba_sagas WHERE id='abc123';id participant initiator status abc123AirlineTravelAgencyCommitted -
The final step corresponds to the
TACoordinatorregistering the finalization status forAirline. This is reflected in thedba_saga_participant_setview.Travel Coordinator PDB:
SELECT id, participant, status FROM dba_saga_participant_set WHERE id='abc123';id participant status abc123TravelAgencyCommitted