Skip to content

Commit

Permalink
Merge pull request #1576 from bcgov/feature/isfsReport
Browse files Browse the repository at this point in the history
Fixes for unique saga result
  • Loading branch information
SodhiA1 authored Jan 29, 2025
2 parents 190c55f + dfbf020 commit d29517b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,14 @@ public void handleReadFromTopicEvent(final Event event) throws JsonProcessingExc
log.trace(EXECUTION_IS_NOT_REQUIRED, event);
return;
}
val saga = this.studentProcessingOrchestrator.createSaga(event.getEventPayload(), UUID.fromString(sagaData.getSdcSchoolCollectionStudent().getSdcSchoolCollectionStudentID()), UUID.fromString(sagaData.getSdcSchoolCollectionStudent().getSdcSchoolCollectionID()), ApplicationProperties.STUDENT_DATA_COLLECTION_API, null);
log.debug("Starting student processing orchestrator :: {}", saga);
this.studentProcessingOrchestrator.startSaga(saga);
try {
val saga = this.studentProcessingOrchestrator.createSaga(event.getEventPayload(), UUID.fromString(sagaData.getSdcSchoolCollectionStudent().getSdcSchoolCollectionStudentID()), UUID.fromString(sagaData.getSdcSchoolCollectionStudent().getSdcSchoolCollectionID()), ApplicationProperties.STUDENT_DATA_COLLECTION_API, null);
log.debug("Starting student processing orchestrator :: {}", saga);
this.studentProcessingOrchestrator.startSaga(saga);
}catch(Exception e){
//This will happen occasionally when we have multiple messages hitting our pods
log.debug("Skipping processing on student {} :: saga already exists :: exception was: {}", sagaData.getSdcSchoolCollectionStudent().getSdcSchoolCollectionStudentID(), e.getMessage());
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE SDC_SAGA
ADD CONSTRAINT UNQ_SDC_SCHOOL_COLLECTION_STUDENT_ID_SAGA_NAME
UNIQUE (SDC_SCHOOL_COLLECTION_STUDENT_ID, SAGA_NAME);

0 comments on commit d29517b

Please sign in to comment.