Skip to content

Instantly share code, notes, and snippets.

View paulparkinson's full-sized avatar

Paul Parkinson paulparkinson

View GitHub Profile
@paulparkinson
paulparkinson / ExampleOracleDatabaseSagaInitiator.java
Last active March 23, 2024 22:46
TravelAgencyController implementation of Oracle Database SagaInitiator
@Participant(name = "TravelAgency")
/* @Participant declares the participant’s name to the saga framework */
public class TravelAgencyController extends SagaInitiator {
/* TravelAgencyController extends the SagaInitiator class */
@LRA(end = false)
/* @LRA annotates the method that begins a saga and invites participants */
@POST("booking")
@Consumes(MediaType.TEXT_PLAIN)
@Produces(MediaType.APPLICATION_JSON)
public jakarta.ws.rs.core.Response booking(
@paulparkinson
paulparkinson / ExampleOracleDatabaseSagaParticipant.java
Created March 23, 2024 22:47
Airline implementation of Oracle Database SagaParticipant
@Participant(name = "Airline")
/* @Participant declares the participant’s name to the saga framework */
public class Airline extends SagaParticipant {
/* Airline extends the SagaParticipant class */
@Request(sender = "TravelAgency")
/* The @Request annotates the method that handles incoming request from a given
sender, in this example the TravelAgency */
public String handleTravelAgencyRequest(SagaMessageContext
info) {