A.1.2 Troubleshooting Steps
-
Java code enters the
@LRA
annotated methodbooking()
of theTravelAgencyController
class.A query on
DBA_SAGAS
on theTravelAgency’s
PDB (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
Airline
formally 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 abc123
TravelAgency
Joined
-
The
Airline
receives the ACK message from the Saga coordinator and initiates the processing of the Saga payload using its@Request
annotated method:handleTravelAgencyRequest()
.Airline PDB (ACK complete):
SELECT id, participant, initiator, status FROM dba_sagas WHERE id='abc123';
id participant initiator status abc123
Airline
TravelAgency
Joined
The 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_Q1
in 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 abc123
TravelAgency
TACoordinator
Committed
-
The
Airline
receives the commit message and initiates its own commit action. This results in the Saga transitioning fromJoined
toCommitted
on the participant PDB. TheAirline
sends 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 abc123
Airline
TravelAgency
Committed
-
The final step corresponds to the
TACoordinator
registering the finalization status forAirline
. This is reflected in thedba_saga_participant_set
view.Travel Coordinator PDB:
SELECT id, participant, status FROM dba_saga_participant_set WHERE id='abc123';
id participant status abc123
TravelAgency
Committed