@@ -80,9 +80,14 @@ public void handleUpdateDemogEvent(final Event event) throws JsonProcessingExcep
80
80
log .trace (EXECUTION_IS_NOT_REQUIRED , event );
81
81
return ;
82
82
}
83
- val saga = this .updateStudentDownstreamOrchestrator .createSaga (event .getEventPayload (), UUID .fromString (updateStudentSagaData .getSdcSchoolCollectionStudentID ()), null , ApplicationProperties .STUDENT_DATA_COLLECTION_API , null );
84
- log .debug ("Starting updateStudentDownstreamOrchestrator orchestrator :: {}" , saga );
85
- this .updateStudentDownstreamOrchestrator .startSaga (saga );
83
+ try {
84
+ val saga = this .updateStudentDownstreamOrchestrator .createSaga (event .getEventPayload (), UUID .fromString (updateStudentSagaData .getSdcSchoolCollectionStudentID ()), null , ApplicationProperties .STUDENT_DATA_COLLECTION_API , null );
85
+ log .debug ("Starting updateStudentDownstreamOrchestrator orchestrator :: {}" , saga );
86
+ this .updateStudentDownstreamOrchestrator .startSaga (saga );
87
+ }catch (Exception e ){
88
+ //This will happen occasionally when we have multiple messages hitting our pods
89
+ log .debug ("Skipping processing on student {} :: saga already exists :: exception was: {}" , updateStudentSagaData .getSdcSchoolCollectionStudentID (), e .getMessage ());
90
+ }
86
91
}
87
92
}
88
93
@@ -95,9 +100,14 @@ public void handleUpdateStudentStatusEvent(final Event event) throws JsonProcess
95
100
log .trace (EXECUTION_IS_NOT_REQUIRED , event );
96
101
return ;
97
102
}
98
- val saga = this .updateStudentStatusOrchestrator .createSaga (event .getEventPayload (), UUID .fromString (updateStudentSagaData .getSdcSchoolCollectionStudentID ()), null , ApplicationProperties .STUDENT_DATA_COLLECTION_API , null );
99
- log .debug ("Starting updateStudentStatusOrchestrator orchestrator :: {}" , saga );
100
- this .updateStudentStatusOrchestrator .startSaga (saga );
103
+ try {
104
+ val saga = this .updateStudentStatusOrchestrator .createSaga (event .getEventPayload (), UUID .fromString (updateStudentSagaData .getSdcSchoolCollectionStudentID ()), null , ApplicationProperties .STUDENT_DATA_COLLECTION_API , null );
105
+ log .debug ("Starting updateStudentStatusOrchestrator orchestrator :: {}" , saga );
106
+ this .updateStudentStatusOrchestrator .startSaga (saga );
107
+ }catch (Exception e ){
108
+ //This will happen occasionally when we have multiple messages hitting our pods
109
+ log .debug ("Skipping processing on student {} :: saga already exists :: exception was: {}" , updateStudentSagaData .getSdcSchoolCollectionStudentID (), e .getMessage ());
110
+ }
101
111
}
102
112
}
103
113
@@ -110,9 +120,14 @@ public void handleMigrateStudentEvent(final Event event) throws JsonProcessingEx
110
120
log .trace (EXECUTION_IS_NOT_REQUIRED , event );
111
121
return ;
112
122
}
113
- val saga = this .sdcStudentMigrationOrchestrator .createSaga (event .getEventPayload (), UUID .fromString (sdcStudentSagaData .getSdcSchoolCollectionStudent ().getSdcSchoolCollectionStudentID ()), null , ApplicationProperties .STUDENT_DATA_COLLECTION_API , null );
114
- log .debug ("Starting updateStudentDownstreamOrchestrator orchestrator :: {}" , saga );
115
- this .sdcStudentMigrationOrchestrator .startSaga (saga );
123
+ try {
124
+ val saga = this .sdcStudentMigrationOrchestrator .createSaga (event .getEventPayload (), UUID .fromString (sdcStudentSagaData .getSdcSchoolCollectionStudent ().getSdcSchoolCollectionStudentID ()), null , ApplicationProperties .STUDENT_DATA_COLLECTION_API , null );
125
+ log .debug ("Starting updateStudentDownstreamOrchestrator orchestrator :: {}" , saga );
126
+ this .sdcStudentMigrationOrchestrator .startSaga (saga );
127
+ }catch (Exception e ){
128
+ //This will happen occasionally when we have multiple messages hitting our pods
129
+ log .debug ("Skipping processing on student {} :: saga already exists :: exception was: {}" , sdcStudentSagaData .getSdcSchoolCollectionStudent ().getSdcSchoolCollectionStudentID (), e .getMessage ());
130
+ }
116
131
}
117
132
}
118
133
}
0 commit comments