From 51225ff8ba8734fd21218e4513c07e8e59788096 Mon Sep 17 00:00:00 2001 From: Joris Mancini Date: Wed, 11 Dec 2024 17:51:37 +0100 Subject: [PATCH 1/3] feat: plug on DLQs to handle computation and build failures Signed-off-by: Joris Mancini --- .../study/server/StudyConstants.java | 1 + .../study/server/service/ConsumerService.java | 4 +- src/main/resources/config/application.yaml | 73 +++++++++++++------ 3 files changed, 55 insertions(+), 23 deletions(-) diff --git a/src/main/java/org/gridsuite/study/server/StudyConstants.java b/src/main/java/org/gridsuite/study/server/StudyConstants.java index 57e5e190d..492b584e4 100644 --- a/src/main/java/org/gridsuite/study/server/StudyConstants.java +++ b/src/main/java/org/gridsuite/study/server/StudyConstants.java @@ -69,6 +69,7 @@ private StudyConstants() { public static final String HEADER_IMPORT_PARAMETERS = "importParameters"; public static final String HEADER_MESSAGE = "message"; public static final String HEADER_USER_ID = "userId"; + public static final String HEADER_RABBIT_ERROR_MESSAGE = "x-exception-message"; public static final String QUERY_PARAM_ONLY_STASHED = "onlyStashed"; public static final String QUERY_PARAM_STASHED = "stashed"; public static final String QUERY_PARAM_ACTIVATED = "activated"; diff --git a/src/main/java/org/gridsuite/study/server/service/ConsumerService.java b/src/main/java/org/gridsuite/study/server/service/ConsumerService.java index ff4cbfdee..608b4b4af 100644 --- a/src/main/java/org/gridsuite/study/server/service/ConsumerService.java +++ b/src/main/java/org/gridsuite/study/server/service/ConsumerService.java @@ -160,7 +160,7 @@ public Consumer> consumeBuildFailed() { // send notification UUID studyUuid = networkModificationTreeService.getStudyUuidForNodeId(receiverObj.getNodeUuid()); - notificationService.emitNodeBuildFailed(studyUuid, receiverObj.getNodeUuid(), message.getHeaders().get(HEADER_MESSAGE, String.class)); + notificationService.emitNodeBuildFailed(studyUuid, receiverObj.getNodeUuid(), message.getHeaders().get(HEADER_RABBIT_ERROR_MESSAGE, String.class)); } catch (JsonProcessingException e) { LOGGER.error(e.toString()); } @@ -314,7 +314,7 @@ public Consumer> consumeCaseImportFailed() { */ public void consumeCalculationFailed(Message msg, ComputationType computationType) { String receiver = msg.getHeaders().get(HEADER_RECEIVER, String.class); - String errorMessage = msg.getHeaders().get(HEADER_MESSAGE, String.class); + String errorMessage = msg.getHeaders().get(HEADER_RABBIT_ERROR_MESSAGE, String.class); String userId = msg.getHeaders().get(HEADER_USER_ID, String.class); UUID resultUuid = null; // resultUuid is only used for the voltage initialization computation, I don't know why diff --git a/src/main/resources/config/application.yaml b/src/main/resources/config/application.yaml index 6c8dd04ab..337ff0361 100644 --- a/src/main/resources/config/application.yaml +++ b/src/main/resources/config/application.yaml @@ -3,7 +3,6 @@ spring: name: study-server main: allow-circular-references: true - cloud: function: definition: "consumeSaResult;consumeSaStopped;consumeSaFailed;consumeSaCancelFailed;\ @@ -32,8 +31,8 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.cancelfailed group: studySaCancelFailedGroup consumeSaFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.failed - group: studySaFailedGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.run.saGroup + group: dlq consumeDsResult-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}ds.result group: studyDsResultGroup @@ -41,8 +40,8 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}ds.stopped group: studyDsStoppedGroup consumeDsFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}ds.failed - group: studyDsFailedGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}ds.run.dsGroup + group: dlq consumeBuildResult-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}build.result group: studyBuildResultGroup @@ -50,8 +49,8 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}build.stopped group: studyBuildStoppedGroup consumeBuildFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}build.failed - group: studyBuildFailedGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}build.run.buildGroup + group: dlq consumeLoadFlowResult-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.result group: studyLoadFlowResultGroup @@ -59,8 +58,8 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.stopped group: studyLoadFlowStoppedGroup consumeLoadFlowFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.failed - group: studyLoadFlowFailedGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.run.loadflowGroup + group: dlq consumeLoadFlowCancelFailed-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.cancelfailed group: studyLoadFlowCancelFailedGroup @@ -71,8 +70,8 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}sensitivityanalysis.stopped group: studySensitivityAnalysisStoppedGroup consumeSensitivityAnalysisFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}sensitivityanalysis.failed - group: studySensitivityAnalysisFailedGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}sensitivityanalysis.run.sensitivityanalysisGroup + group: dlq consumeSensitivityAnalysisCancelFailed-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}sensitivityanalysis.cancelfailed group: studySensitivityAnalysisCancelFailedGroup @@ -83,8 +82,8 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}nonEvacuatedEnergy.stopped group: studyNonEvacuatedEnergyStoppedGroup consumeNonEvacuatedEnergyFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}nonEvacuatedEnergy.failed - group: studyNonEvacuatedEnergyFailedGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}nonEvacuatedEnergy.run.sensitivityanalysisGroup + group: dlq consumeNonEvacuatedEnergyCancelFailed-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}nonEvacuatedEnergy.cancelfailed group: studyNonEvacuatedEnergyCancelFailedGroup @@ -95,8 +94,8 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}shortcircuitanalysis.stopped group: studyShortCircuitAnalysisStoppedGroup consumeShortCircuitAnalysisFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}shortcircuitanalysis.failed - group: studyShortCircuitAnalysisFailedGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}shortcircuitanalysis.run.shortcircuitanalysisGroup + group: dlq consumeShortCircuitAnalysisCancelFailed-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}shortcircuitanalysis.cancelfailed group: studyShortCircuitAnalysisCancelFailedGroup @@ -107,8 +106,8 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}voltageinit.stopped group: studyVoltageInitStoppedGroup consumeVoltageInitFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}voltageinit.failed - group: studyVoltageInitFailedGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}voltageinit.run.voltageinitGroup + group: dlq consumeVoltageInitCancelFailed-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}voltageinit.cancelfailed group: studyVoltageInitCancelFailedGroup @@ -119,15 +118,47 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}stateestimation.stopped group: studyStateEstimationStoppedGroup consumeStateEstimationFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}stateestimation.failed - group: studyStateEstimationFailedGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}stateestimation.run.stateestimationGroup + group: dlq consumeCaseImportSucceeded-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}case.import.succeeded group: studyCaseImportSucceededGroup consumeCaseImportFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}case.import.failed - group: studyCaseImportFailedGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}case.import.start.importGroup + group: dlq output-bindings: publishStudyUpdate-out-0;publishElementUpdate-out-0 + rabbit: + bindings: + consumeSaFailed-in-0: + consumer: + declare-exchange: false + consumeDsFailed-in-0: + consumer: + declare-exchange: false + consumeBuildFailed-in-0: + consumer: + declare-exchange: false + consumeLoadFlowFailed-in-0: + consumer: + declare-exchange: false + consumeSensitivityAnalysisFailed-in-0: + consumer: + declare-exchange: false + consumeNonEvacuatedEnergyFailed-in-0: + consumer: + declare-exchange: false + consumeShortCircuitAnalysisFailed-in-0: + consumer: + declare-exchange: false + consumeVoltageInitFailed-in-0: + consumer: + declare-exchange: false + consumeStateEstimationFailed-in-0: + consumer: + declare-exchange: false + consumeCaseImportFailed-in-0: + consumer: + declare-exchange: false powsybl: services: From 2180c866df6b69253d530156d4ab55e7c1875e82 Mon Sep 17 00:00:00 2001 From: Joris Mancini Date: Thu, 12 Dec 2024 17:29:25 +0100 Subject: [PATCH 2/3] fix: rename queues and fix tests Signed-off-by: Joris Mancini --- .../study/server/StudyConstants.java | 2 +- .../study/server/service/ConsumerService.java | 5 +++-- src/main/resources/config/application.yaml | 20 +++++++++---------- .../gridsuite/study/server/LoadFlowTest.java | 2 +- .../study/server/NetworkModificationTest.java | 3 ++- .../study/server/NonEvacuatedEnergyTest.java | 2 +- .../study/server/SecurityAnalysisTest.java | 2 +- .../study/server/SensitivityAnalysisTest.java | 2 +- .../study/server/ShortCircuitTest.java | 2 +- .../study/server/StateEstimationTest.java | 2 +- .../StudyControllerDynamicSimulationTest.java | 2 +- .../org/gridsuite/study/server/StudyTest.java | 2 +- .../study/server/VoltageInitTest.java | 2 +- 13 files changed, 25 insertions(+), 23 deletions(-) diff --git a/src/main/java/org/gridsuite/study/server/StudyConstants.java b/src/main/java/org/gridsuite/study/server/StudyConstants.java index 492b584e4..e53e58c31 100644 --- a/src/main/java/org/gridsuite/study/server/StudyConstants.java +++ b/src/main/java/org/gridsuite/study/server/StudyConstants.java @@ -69,7 +69,7 @@ private StudyConstants() { public static final String HEADER_IMPORT_PARAMETERS = "importParameters"; public static final String HEADER_MESSAGE = "message"; public static final String HEADER_USER_ID = "userId"; - public static final String HEADER_RABBIT_ERROR_MESSAGE = "x-exception-message"; + public static final String HEADER_ERROR_MESSAGE = "x-exception-message"; public static final String QUERY_PARAM_ONLY_STASHED = "onlyStashed"; public static final String QUERY_PARAM_STASHED = "stashed"; public static final String QUERY_PARAM_ACTIVATED = "activated"; diff --git a/src/main/java/org/gridsuite/study/server/service/ConsumerService.java b/src/main/java/org/gridsuite/study/server/service/ConsumerService.java index 608b4b4af..b0527a44a 100644 --- a/src/main/java/org/gridsuite/study/server/service/ConsumerService.java +++ b/src/main/java/org/gridsuite/study/server/service/ConsumerService.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.util.Strings; +import org.gridsuite.study.server.StudyConstants; import org.gridsuite.study.server.dto.*; import org.gridsuite.study.server.dto.dynamicsimulation.DynamicSimulationParametersInfos; import org.gridsuite.study.server.dto.modification.NetworkModificationResult; @@ -160,7 +161,7 @@ public Consumer> consumeBuildFailed() { // send notification UUID studyUuid = networkModificationTreeService.getStudyUuidForNodeId(receiverObj.getNodeUuid()); - notificationService.emitNodeBuildFailed(studyUuid, receiverObj.getNodeUuid(), message.getHeaders().get(HEADER_RABBIT_ERROR_MESSAGE, String.class)); + notificationService.emitNodeBuildFailed(studyUuid, receiverObj.getNodeUuid(), message.getHeaders().get(StudyConstants.HEADER_ERROR_MESSAGE, String.class)); } catch (JsonProcessingException e) { LOGGER.error(e.toString()); } @@ -314,7 +315,7 @@ public Consumer> consumeCaseImportFailed() { */ public void consumeCalculationFailed(Message msg, ComputationType computationType) { String receiver = msg.getHeaders().get(HEADER_RECEIVER, String.class); - String errorMessage = msg.getHeaders().get(HEADER_RABBIT_ERROR_MESSAGE, String.class); + String errorMessage = msg.getHeaders().get(StudyConstants.HEADER_ERROR_MESSAGE, String.class); String userId = msg.getHeaders().get(HEADER_USER_ID, String.class); UUID resultUuid = null; // resultUuid is only used for the voltage initialization computation, I don't know why diff --git a/src/main/resources/config/application.yaml b/src/main/resources/config/application.yaml index 337ff0361..ea835c820 100644 --- a/src/main/resources/config/application.yaml +++ b/src/main/resources/config/application.yaml @@ -31,7 +31,7 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.cancelfailed group: studySaCancelFailedGroup consumeSaFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.run.saGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.run group: dlq consumeDsResult-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}ds.result @@ -40,7 +40,7 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}ds.stopped group: studyDsStoppedGroup consumeDsFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}ds.run.dsGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}ds.run group: dlq consumeBuildResult-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}build.result @@ -49,7 +49,7 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}build.stopped group: studyBuildStoppedGroup consumeBuildFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}build.run.buildGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}build.run group: dlq consumeLoadFlowResult-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.result @@ -58,7 +58,7 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.stopped group: studyLoadFlowStoppedGroup consumeLoadFlowFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.run.loadflowGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.run group: dlq consumeLoadFlowCancelFailed-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.cancelfailed @@ -70,7 +70,7 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}sensitivityanalysis.stopped group: studySensitivityAnalysisStoppedGroup consumeSensitivityAnalysisFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}sensitivityanalysis.run.sensitivityanalysisGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}sensitivityanalysis.run group: dlq consumeSensitivityAnalysisCancelFailed-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}sensitivityanalysis.cancelfailed @@ -82,7 +82,7 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}nonEvacuatedEnergy.stopped group: studyNonEvacuatedEnergyStoppedGroup consumeNonEvacuatedEnergyFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}nonEvacuatedEnergy.run.sensitivityanalysisGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}nonEvacuatedEnergy.run group: dlq consumeNonEvacuatedEnergyCancelFailed-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}nonEvacuatedEnergy.cancelfailed @@ -94,7 +94,7 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}shortcircuitanalysis.stopped group: studyShortCircuitAnalysisStoppedGroup consumeShortCircuitAnalysisFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}shortcircuitanalysis.run.shortcircuitanalysisGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}shortcircuitanalysis.run group: dlq consumeShortCircuitAnalysisCancelFailed-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}shortcircuitanalysis.cancelfailed @@ -106,7 +106,7 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}voltageinit.stopped group: studyVoltageInitStoppedGroup consumeVoltageInitFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}voltageinit.run.voltageinitGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}voltageinit.run group: dlq consumeVoltageInitCancelFailed-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}voltageinit.cancelfailed @@ -118,13 +118,13 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}stateestimation.stopped group: studyStateEstimationStoppedGroup consumeStateEstimationFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}stateestimation.run.stateestimationGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}stateestimation.run group: dlq consumeCaseImportSucceeded-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}case.import.succeeded group: studyCaseImportSucceededGroup consumeCaseImportFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}case.import.start.importGroup + destination: ${powsybl-ws.rabbitmq.destination.prefix:}case.import.start group: dlq output-bindings: publishStudyUpdate-out-0;publishElementUpdate-out-0 rabbit: diff --git a/src/test/java/org/gridsuite/study/server/LoadFlowTest.java b/src/test/java/org/gridsuite/study/server/LoadFlowTest.java index cbbfd73ec..c2cf388ff 100644 --- a/src/test/java/org/gridsuite/study/server/LoadFlowTest.java +++ b/src/test/java/org/gridsuite/study/server/LoadFlowTest.java @@ -141,7 +141,7 @@ class LoadFlowTest { private static final String ELEMENT_UPDATE_DESTINATION = "element.update"; private static final String LOADFLOW_RESULT_DESTINATION = "loadflow.result"; private static final String LOADFLOW_STOPPED_DESTINATION = "loadflow.stopped"; - private static final String LOADFLOW_FAILED_DESTINATION = "loadflow.failed"; + private static final String LOADFLOW_FAILED_DESTINATION = "loadflow.run"; @Autowired private MockMvc mockMvc; diff --git a/src/test/java/org/gridsuite/study/server/NetworkModificationTest.java b/src/test/java/org/gridsuite/study/server/NetworkModificationTest.java index cdadbd458..dc9e71373 100644 --- a/src/test/java/org/gridsuite/study/server/NetworkModificationTest.java +++ b/src/test/java/org/gridsuite/study/server/NetworkModificationTest.java @@ -71,6 +71,7 @@ import java.util.*; import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; +import static org.gridsuite.study.server.StudyConstants.HEADER_ERROR_MESSAGE; import static org.gridsuite.study.server.StudyConstants.QUERY_PARAM_RECEIVER; import static org.gridsuite.study.server.utils.ImpactUtils.createModificationResultWithElementImpact; import static org.gridsuite.study.server.utils.MatcherCreatedStudyBasicInfos.createMatcherCreatedStudyBasicInfos; @@ -263,7 +264,7 @@ void setup(final MockWebServer server) { .withPostServeAction(POST_ACTION_SEND_INPUT, Map.of("payload", DEFAULT_BUILD_RESULT, "destination", "build.result")) .willReturn(WireMock.ok())).getId(); buildFailedStubId = wireMockServer.stubFor(WireMock.post(WireMock.urlPathEqualTo("/v1/networks/" + NETWORK_UUID_2_STRING + "/build")) - .withPostServeAction(POST_ACTION_SEND_INPUT, Map.of("payload", "", "destination", "build.failed", "message", ERROR_MESSAGE)) + .withPostServeAction(POST_ACTION_SEND_INPUT, Map.of("payload", "", "destination", "build.run", HEADER_ERROR_MESSAGE, ERROR_MESSAGE)) .willReturn(WireMock.ok())).getId(); buildErrorStubId = wireMockServer.stubFor(WireMock.post(WireMock.urlPathEqualTo("/v1/networks/" + NETWORK_UUID_3_STRING + "/build")) .willReturn(WireMock.serverError())).getId(); diff --git a/src/test/java/org/gridsuite/study/server/NonEvacuatedEnergyTest.java b/src/test/java/org/gridsuite/study/server/NonEvacuatedEnergyTest.java index 84ea1f30c..e99fa5952 100644 --- a/src/test/java/org/gridsuite/study/server/NonEvacuatedEnergyTest.java +++ b/src/test/java/org/gridsuite/study/server/NonEvacuatedEnergyTest.java @@ -154,7 +154,7 @@ class NonEvacuatedEnergyTest { private static final String STUDY_UPDATE_DESTINATION = "study.update"; private static final String NON_EVACUATED_ENERGY_RESULT_DESTINATION = "nonEvacuatedEnergy.result"; private static final String NON_EVACUATED_ENERGY_STOPPED_DESTINATION = "nonEvacuatedEnergy.stopped"; - private static final String NON_EVACUATED_ENERGY_FAILED_DESTINATION = "nonEvacuatedEnergy.failed"; + private static final String NON_EVACUATED_ENERGY_FAILED_DESTINATION = "nonEvacuatedEnergy.run"; @Autowired private RootNetworkNodeInfoService rootNetworkNodeInfoService; @Autowired diff --git a/src/test/java/org/gridsuite/study/server/SecurityAnalysisTest.java b/src/test/java/org/gridsuite/study/server/SecurityAnalysisTest.java index c6d4d55a5..c5345f350 100644 --- a/src/test/java/org/gridsuite/study/server/SecurityAnalysisTest.java +++ b/src/test/java/org/gridsuite/study/server/SecurityAnalysisTest.java @@ -159,7 +159,7 @@ class SecurityAnalysisTest { private final String studyUpdateDestination = "study.update"; private final String saResultDestination = "sa.result"; private final String saStoppedDestination = "sa.stopped"; - private final String saFailedDestination = "sa.failed"; + private final String saFailedDestination = "sa.run"; @Autowired private RootNetworkNodeInfoService rootNetworkNodeInfoService; @Autowired diff --git a/src/test/java/org/gridsuite/study/server/SensitivityAnalysisTest.java b/src/test/java/org/gridsuite/study/server/SensitivityAnalysisTest.java index b6e61a5c1..bfa8f0ca4 100644 --- a/src/test/java/org/gridsuite/study/server/SensitivityAnalysisTest.java +++ b/src/test/java/org/gridsuite/study/server/SensitivityAnalysisTest.java @@ -155,7 +155,7 @@ class SensitivityAnalysisTest { private static final String ELEMENT_UPDATE_DESTINATION = "element.update"; private static final String SENSITIVITY_ANALYSIS_RESULT_DESTINATION = "sensitivityanalysis.result"; private static final String SENSITIVITY_ANALYSIS_STOPPED_DESTINATION = "sensitivityanalysis.stopped"; - private static final String SENSITIVITY_ANALYSIS_FAILED_DESTINATION = "sensitivityanalysis.failed"; + private static final String SENSITIVITY_ANALYSIS_FAILED_DESTINATION = "sensitivityanalysis.run"; public static final String SENSITIVITY_ANALYSIS_DEFAULT_PARAMETERS_JSON = "{\"flowFlowSensitivityValueThreshold\":0.0,\"angleFlowSensitivityValueThreshold\":0.0,\"flowVoltageSensitivityValueThreshold\":0.0," + "\"sensitivityInjectionsSet\":[],\"sensitivityInjection\":[],\"sensitivityHVDC\":[],\"sensitivityPST\":[],\"sensitivityNodes\":[]}"; diff --git a/src/test/java/org/gridsuite/study/server/ShortCircuitTest.java b/src/test/java/org/gridsuite/study/server/ShortCircuitTest.java index af8b6e93c..2c04373bb 100644 --- a/src/test/java/org/gridsuite/study/server/ShortCircuitTest.java +++ b/src/test/java/org/gridsuite/study/server/ShortCircuitTest.java @@ -147,7 +147,7 @@ class ShortCircuitTest implements WithAssertions { private final String studyUpdateDestination = "study.update"; private final String shortCircuitAnalysisResultDestination = "shortcircuitanalysis.result"; private final String shortCircuitAnalysisStoppedDestination = "shortcircuitanalysis.stopped"; - private final String shortCircuitAnalysisFailedDestination = "shortcircuitanalysis.failed"; + private final String shortCircuitAnalysisFailedDestination = "shortcircuitanalysis.run"; @Autowired private StudyService studyService; diff --git a/src/test/java/org/gridsuite/study/server/StateEstimationTest.java b/src/test/java/org/gridsuite/study/server/StateEstimationTest.java index b98ec4e23..8235a1f6f 100644 --- a/src/test/java/org/gridsuite/study/server/StateEstimationTest.java +++ b/src/test/java/org/gridsuite/study/server/StateEstimationTest.java @@ -100,7 +100,7 @@ class StateEstimationTest { private static final String STUDY_UPDATE_DESTINATION = "study.update"; private static final String ESTIM_RESULT_JSON_DESTINATION = "stateestimation.result"; private static final String ESTIM_STOPPED_DESTINATION = "stateestimation.stopped"; - private static final String ESTIM_FAILED_DESTINATION = "stateestimation.failed"; + private static final String ESTIM_FAILED_DESTINATION = "stateestimation.run"; @Autowired private MockMvc mockMvc; diff --git a/src/test/java/org/gridsuite/study/server/StudyControllerDynamicSimulationTest.java b/src/test/java/org/gridsuite/study/server/StudyControllerDynamicSimulationTest.java index af676e6d5..3495ca096 100644 --- a/src/test/java/org/gridsuite/study/server/StudyControllerDynamicSimulationTest.java +++ b/src/test/java/org/gridsuite/study/server/StudyControllerDynamicSimulationTest.java @@ -192,7 +192,7 @@ class StudyControllerDynamicSimulationTest { private static final String STUDY_UPDATE_DESTINATION = "study.update"; private static final String DS_RESULT_DESTINATION = "ds.result"; private static final String DS_STOPPED_DESTINATION = "ds.stopped"; - private static final String DS_FAILED_DESTINATION = "ds.failed"; + private static final String DS_FAILED_DESTINATION = "ds.run"; @BeforeEach public void setup() { diff --git a/src/test/java/org/gridsuite/study/server/StudyTest.java b/src/test/java/org/gridsuite/study/server/StudyTest.java index 479cff487..1301f7fb2 100644 --- a/src/test/java/org/gridsuite/study/server/StudyTest.java +++ b/src/test/java/org/gridsuite/study/server/StudyTest.java @@ -610,7 +610,7 @@ private void sendCaseImportFailedMessage(String requestPath, String errorMessage String receiverUrlString = matcher.group(1); input.send(MessageBuilder.withPayload("").setHeader("receiver", URLDecoder.decode(receiverUrlString, StandardCharsets.UTF_8)) .setHeader("errorMessage", errorMessage) - .build(), "case.import.failed"); + .build(), "case.import.start"); } } diff --git a/src/test/java/org/gridsuite/study/server/VoltageInitTest.java b/src/test/java/org/gridsuite/study/server/VoltageInitTest.java index 9c16af8d8..0486f27ed 100644 --- a/src/test/java/org/gridsuite/study/server/VoltageInitTest.java +++ b/src/test/java/org/gridsuite/study/server/VoltageInitTest.java @@ -203,7 +203,7 @@ class VoltageInitTest { private final String studyUpdateDestination = "study.update"; private final String voltageInitResultDestination = "voltageinit.result"; private final String voltageInitStoppedDestination = "voltageinit.stopped"; - private final String voltageInitFailedDestination = "voltageinit.failed"; + private final String voltageInitFailedDestination = "voltageinit.run"; private final String voltageInitCancelFailedDestination = "voltageinit.cancelfailed"; private final String elementUpdateDestination = "element.update"; @Autowired From 394239c04c0d66571ddb926bc4b8c4b77370acdc Mon Sep 17 00:00:00 2001 From: Joris Mancini Date: Fri, 13 Dec 2024 16:05:22 +0100 Subject: [PATCH 3/3] fix: rename queues and fix tests again Signed-off-by: Joris Mancini --- src/main/resources/config/application.yaml | 52 ++++--------------- .../gridsuite/study/server/LoadFlowTest.java | 2 +- .../study/server/NetworkModificationTest.java | 2 +- .../study/server/NonEvacuatedEnergyTest.java | 2 +- .../study/server/SecurityAnalysisTest.java | 2 +- .../study/server/SensitivityAnalysisTest.java | 2 +- .../study/server/ShortCircuitTest.java | 2 +- .../study/server/StateEstimationTest.java | 2 +- .../StudyControllerDynamicSimulationTest.java | 2 +- .../org/gridsuite/study/server/StudyTest.java | 2 +- .../study/server/VoltageInitTest.java | 2 +- 11 files changed, 20 insertions(+), 52 deletions(-) diff --git a/src/main/resources/config/application.yaml b/src/main/resources/config/application.yaml index ea835c820..12d808690 100644 --- a/src/main/resources/config/application.yaml +++ b/src/main/resources/config/application.yaml @@ -31,7 +31,7 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.cancelfailed group: studySaCancelFailedGroup consumeSaFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.run + destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.run.dlx group: dlq consumeDsResult-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}ds.result @@ -40,7 +40,7 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}ds.stopped group: studyDsStoppedGroup consumeDsFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}ds.run + destination: ${powsybl-ws.rabbitmq.destination.prefix:}ds.run.dlx group: dlq consumeBuildResult-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}build.result @@ -49,7 +49,7 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}build.stopped group: studyBuildStoppedGroup consumeBuildFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}build.run + destination: ${powsybl-ws.rabbitmq.destination.prefix:}build.run.dlx group: dlq consumeLoadFlowResult-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.result @@ -58,7 +58,7 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.stopped group: studyLoadFlowStoppedGroup consumeLoadFlowFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.run + destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.run.dlx group: dlq consumeLoadFlowCancelFailed-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}loadflow.cancelfailed @@ -70,7 +70,7 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}sensitivityanalysis.stopped group: studySensitivityAnalysisStoppedGroup consumeSensitivityAnalysisFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}sensitivityanalysis.run + destination: ${powsybl-ws.rabbitmq.destination.prefix:}sensitivityanalysis.run.dlx group: dlq consumeSensitivityAnalysisCancelFailed-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}sensitivityanalysis.cancelfailed @@ -82,7 +82,7 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}nonEvacuatedEnergy.stopped group: studyNonEvacuatedEnergyStoppedGroup consumeNonEvacuatedEnergyFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}nonEvacuatedEnergy.run + destination: ${powsybl-ws.rabbitmq.destination.prefix:}nonEvacuatedEnergy.run.dlx group: dlq consumeNonEvacuatedEnergyCancelFailed-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}nonEvacuatedEnergy.cancelfailed @@ -94,7 +94,7 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}shortcircuitanalysis.stopped group: studyShortCircuitAnalysisStoppedGroup consumeShortCircuitAnalysisFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}shortcircuitanalysis.run + destination: ${powsybl-ws.rabbitmq.destination.prefix:}shortcircuitanalysis.run.dlx group: dlq consumeShortCircuitAnalysisCancelFailed-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}shortcircuitanalysis.cancelfailed @@ -106,7 +106,7 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}voltageinit.stopped group: studyVoltageInitStoppedGroup consumeVoltageInitFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}voltageinit.run + destination: ${powsybl-ws.rabbitmq.destination.prefix:}voltageinit.run.dlx group: dlq consumeVoltageInitCancelFailed-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}voltageinit.cancelfailed @@ -118,47 +118,15 @@ spring: destination: ${powsybl-ws.rabbitmq.destination.prefix:}stateestimation.stopped group: studyStateEstimationStoppedGroup consumeStateEstimationFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}stateestimation.run + destination: ${powsybl-ws.rabbitmq.destination.prefix:}stateestimation.run.dlx group: dlq consumeCaseImportSucceeded-in-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}case.import.succeeded group: studyCaseImportSucceededGroup consumeCaseImportFailed-in-0: - destination: ${powsybl-ws.rabbitmq.destination.prefix:}case.import.start + destination: ${powsybl-ws.rabbitmq.destination.prefix:}case.import.start.dlx group: dlq output-bindings: publishStudyUpdate-out-0;publishElementUpdate-out-0 - rabbit: - bindings: - consumeSaFailed-in-0: - consumer: - declare-exchange: false - consumeDsFailed-in-0: - consumer: - declare-exchange: false - consumeBuildFailed-in-0: - consumer: - declare-exchange: false - consumeLoadFlowFailed-in-0: - consumer: - declare-exchange: false - consumeSensitivityAnalysisFailed-in-0: - consumer: - declare-exchange: false - consumeNonEvacuatedEnergyFailed-in-0: - consumer: - declare-exchange: false - consumeShortCircuitAnalysisFailed-in-0: - consumer: - declare-exchange: false - consumeVoltageInitFailed-in-0: - consumer: - declare-exchange: false - consumeStateEstimationFailed-in-0: - consumer: - declare-exchange: false - consumeCaseImportFailed-in-0: - consumer: - declare-exchange: false powsybl: services: diff --git a/src/test/java/org/gridsuite/study/server/LoadFlowTest.java b/src/test/java/org/gridsuite/study/server/LoadFlowTest.java index c2cf388ff..73a777ae9 100644 --- a/src/test/java/org/gridsuite/study/server/LoadFlowTest.java +++ b/src/test/java/org/gridsuite/study/server/LoadFlowTest.java @@ -141,7 +141,7 @@ class LoadFlowTest { private static final String ELEMENT_UPDATE_DESTINATION = "element.update"; private static final String LOADFLOW_RESULT_DESTINATION = "loadflow.result"; private static final String LOADFLOW_STOPPED_DESTINATION = "loadflow.stopped"; - private static final String LOADFLOW_FAILED_DESTINATION = "loadflow.run"; + private static final String LOADFLOW_FAILED_DESTINATION = "loadflow.run.dlx"; @Autowired private MockMvc mockMvc; diff --git a/src/test/java/org/gridsuite/study/server/NetworkModificationTest.java b/src/test/java/org/gridsuite/study/server/NetworkModificationTest.java index dc9e71373..84eb597ee 100644 --- a/src/test/java/org/gridsuite/study/server/NetworkModificationTest.java +++ b/src/test/java/org/gridsuite/study/server/NetworkModificationTest.java @@ -264,7 +264,7 @@ void setup(final MockWebServer server) { .withPostServeAction(POST_ACTION_SEND_INPUT, Map.of("payload", DEFAULT_BUILD_RESULT, "destination", "build.result")) .willReturn(WireMock.ok())).getId(); buildFailedStubId = wireMockServer.stubFor(WireMock.post(WireMock.urlPathEqualTo("/v1/networks/" + NETWORK_UUID_2_STRING + "/build")) - .withPostServeAction(POST_ACTION_SEND_INPUT, Map.of("payload", "", "destination", "build.run", HEADER_ERROR_MESSAGE, ERROR_MESSAGE)) + .withPostServeAction(POST_ACTION_SEND_INPUT, Map.of("payload", "", "destination", "build.run.dlx", HEADER_ERROR_MESSAGE, ERROR_MESSAGE)) .willReturn(WireMock.ok())).getId(); buildErrorStubId = wireMockServer.stubFor(WireMock.post(WireMock.urlPathEqualTo("/v1/networks/" + NETWORK_UUID_3_STRING + "/build")) .willReturn(WireMock.serverError())).getId(); diff --git a/src/test/java/org/gridsuite/study/server/NonEvacuatedEnergyTest.java b/src/test/java/org/gridsuite/study/server/NonEvacuatedEnergyTest.java index e99fa5952..0b30babca 100644 --- a/src/test/java/org/gridsuite/study/server/NonEvacuatedEnergyTest.java +++ b/src/test/java/org/gridsuite/study/server/NonEvacuatedEnergyTest.java @@ -154,7 +154,7 @@ class NonEvacuatedEnergyTest { private static final String STUDY_UPDATE_DESTINATION = "study.update"; private static final String NON_EVACUATED_ENERGY_RESULT_DESTINATION = "nonEvacuatedEnergy.result"; private static final String NON_EVACUATED_ENERGY_STOPPED_DESTINATION = "nonEvacuatedEnergy.stopped"; - private static final String NON_EVACUATED_ENERGY_FAILED_DESTINATION = "nonEvacuatedEnergy.run"; + private static final String NON_EVACUATED_ENERGY_FAILED_DESTINATION = "nonEvacuatedEnergy.run.dlx"; @Autowired private RootNetworkNodeInfoService rootNetworkNodeInfoService; @Autowired diff --git a/src/test/java/org/gridsuite/study/server/SecurityAnalysisTest.java b/src/test/java/org/gridsuite/study/server/SecurityAnalysisTest.java index c5345f350..36171e9b1 100644 --- a/src/test/java/org/gridsuite/study/server/SecurityAnalysisTest.java +++ b/src/test/java/org/gridsuite/study/server/SecurityAnalysisTest.java @@ -159,7 +159,7 @@ class SecurityAnalysisTest { private final String studyUpdateDestination = "study.update"; private final String saResultDestination = "sa.result"; private final String saStoppedDestination = "sa.stopped"; - private final String saFailedDestination = "sa.run"; + private final String saFailedDestination = "sa.run.dlx"; @Autowired private RootNetworkNodeInfoService rootNetworkNodeInfoService; @Autowired diff --git a/src/test/java/org/gridsuite/study/server/SensitivityAnalysisTest.java b/src/test/java/org/gridsuite/study/server/SensitivityAnalysisTest.java index bfa8f0ca4..bfb7e988d 100644 --- a/src/test/java/org/gridsuite/study/server/SensitivityAnalysisTest.java +++ b/src/test/java/org/gridsuite/study/server/SensitivityAnalysisTest.java @@ -155,7 +155,7 @@ class SensitivityAnalysisTest { private static final String ELEMENT_UPDATE_DESTINATION = "element.update"; private static final String SENSITIVITY_ANALYSIS_RESULT_DESTINATION = "sensitivityanalysis.result"; private static final String SENSITIVITY_ANALYSIS_STOPPED_DESTINATION = "sensitivityanalysis.stopped"; - private static final String SENSITIVITY_ANALYSIS_FAILED_DESTINATION = "sensitivityanalysis.run"; + private static final String SENSITIVITY_ANALYSIS_FAILED_DESTINATION = "sensitivityanalysis.run.dlx"; public static final String SENSITIVITY_ANALYSIS_DEFAULT_PARAMETERS_JSON = "{\"flowFlowSensitivityValueThreshold\":0.0,\"angleFlowSensitivityValueThreshold\":0.0,\"flowVoltageSensitivityValueThreshold\":0.0," + "\"sensitivityInjectionsSet\":[],\"sensitivityInjection\":[],\"sensitivityHVDC\":[],\"sensitivityPST\":[],\"sensitivityNodes\":[]}"; diff --git a/src/test/java/org/gridsuite/study/server/ShortCircuitTest.java b/src/test/java/org/gridsuite/study/server/ShortCircuitTest.java index 2c04373bb..6d8766a9a 100644 --- a/src/test/java/org/gridsuite/study/server/ShortCircuitTest.java +++ b/src/test/java/org/gridsuite/study/server/ShortCircuitTest.java @@ -147,7 +147,7 @@ class ShortCircuitTest implements WithAssertions { private final String studyUpdateDestination = "study.update"; private final String shortCircuitAnalysisResultDestination = "shortcircuitanalysis.result"; private final String shortCircuitAnalysisStoppedDestination = "shortcircuitanalysis.stopped"; - private final String shortCircuitAnalysisFailedDestination = "shortcircuitanalysis.run"; + private final String shortCircuitAnalysisFailedDestination = "shortcircuitanalysis.run.dlx"; @Autowired private StudyService studyService; diff --git a/src/test/java/org/gridsuite/study/server/StateEstimationTest.java b/src/test/java/org/gridsuite/study/server/StateEstimationTest.java index 8235a1f6f..71cc6f2e8 100644 --- a/src/test/java/org/gridsuite/study/server/StateEstimationTest.java +++ b/src/test/java/org/gridsuite/study/server/StateEstimationTest.java @@ -100,7 +100,7 @@ class StateEstimationTest { private static final String STUDY_UPDATE_DESTINATION = "study.update"; private static final String ESTIM_RESULT_JSON_DESTINATION = "stateestimation.result"; private static final String ESTIM_STOPPED_DESTINATION = "stateestimation.stopped"; - private static final String ESTIM_FAILED_DESTINATION = "stateestimation.run"; + private static final String ESTIM_FAILED_DESTINATION = "stateestimation.run.dlx"; @Autowired private MockMvc mockMvc; diff --git a/src/test/java/org/gridsuite/study/server/StudyControllerDynamicSimulationTest.java b/src/test/java/org/gridsuite/study/server/StudyControllerDynamicSimulationTest.java index 3495ca096..85afee08f 100644 --- a/src/test/java/org/gridsuite/study/server/StudyControllerDynamicSimulationTest.java +++ b/src/test/java/org/gridsuite/study/server/StudyControllerDynamicSimulationTest.java @@ -192,7 +192,7 @@ class StudyControllerDynamicSimulationTest { private static final String STUDY_UPDATE_DESTINATION = "study.update"; private static final String DS_RESULT_DESTINATION = "ds.result"; private static final String DS_STOPPED_DESTINATION = "ds.stopped"; - private static final String DS_FAILED_DESTINATION = "ds.run"; + private static final String DS_FAILED_DESTINATION = "ds.run.dlx"; @BeforeEach public void setup() { diff --git a/src/test/java/org/gridsuite/study/server/StudyTest.java b/src/test/java/org/gridsuite/study/server/StudyTest.java index 1301f7fb2..e50b0ac0a 100644 --- a/src/test/java/org/gridsuite/study/server/StudyTest.java +++ b/src/test/java/org/gridsuite/study/server/StudyTest.java @@ -610,7 +610,7 @@ private void sendCaseImportFailedMessage(String requestPath, String errorMessage String receiverUrlString = matcher.group(1); input.send(MessageBuilder.withPayload("").setHeader("receiver", URLDecoder.decode(receiverUrlString, StandardCharsets.UTF_8)) .setHeader("errorMessage", errorMessage) - .build(), "case.import.start"); + .build(), "case.import.start.dlx"); } } diff --git a/src/test/java/org/gridsuite/study/server/VoltageInitTest.java b/src/test/java/org/gridsuite/study/server/VoltageInitTest.java index 0486f27ed..88da21fca 100644 --- a/src/test/java/org/gridsuite/study/server/VoltageInitTest.java +++ b/src/test/java/org/gridsuite/study/server/VoltageInitTest.java @@ -203,7 +203,7 @@ class VoltageInitTest { private final String studyUpdateDestination = "study.update"; private final String voltageInitResultDestination = "voltageinit.result"; private final String voltageInitStoppedDestination = "voltageinit.stopped"; - private final String voltageInitFailedDestination = "voltageinit.run"; + private final String voltageInitFailedDestination = "voltageinit.run.dlx"; private final String voltageInitCancelFailedDestination = "voltageinit.cancelfailed"; private final String elementUpdateDestination = "element.update"; @Autowired