Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: redirect build failures on rabbit dlq #122

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

TheMaskedTurtle
Copy link
Contributor

No description provided.

Signed-off-by: Joris Mancini <[email protected]>
pom.xml Outdated
@@ -84,7 +84,11 @@
<dependencyManagement>
<dependencies>
<!-- overrides of imports -->

<dependency>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to remove next powsybl upgrade?

Comment on lines -108 to -109
Map<String, Object> additionalHeaders = new HashMap<>();
additionalHeaders.put(HEADER_BUS_ID, busId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure we can remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes because it is set in the run message already, so if it is defined in the run message it will be forwarded in the DLQ

assertEquals("me", failedMessage.getHeaders().get("receiver"));
assertEquals("BUSBARSECTION_ID_NOT_EXISTING", failedMessage.getHeaders().get(HEADER_BUS_ID));

assertNull(output.receive(TIMEOUT, shortCircuitAnalysisResultDestination));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why can't we have the same message without the additional header?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check computationexception?

Message<byte[]> resultMessage = output.receive(TIMEOUT, shortCircuitAnalysisFailedDestination);
assertEquals("Short circuit analysis has failed : Missing short-circuit extension data", resultMessage.getHeaders().get("message"));
assertEquals(RESULT_UUID.toString(), resultMessage.getHeaders().get("resultUuid"));
assertEquals("me", resultMessage.getHeaders().get("receiver"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why can't we have the same message without the additional header?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check computationexception?

@@ -148,8 +150,7 @@ void testGetBusFaultFromOutOfVoltageBus() throws Exception {
try (var shortCircuitAnalysisMockedStatic = TestUtils.injectShortCircuitAnalysisProvider(analysisProvider);
var shortCircuitResultContextMockedStatic = mockStatic(ShortCircuitResultContext.class)) {
shortCircuitResultContextMockedStatic.when(() -> ShortCircuitResultContext.fromMessage(message, objectMapper)).thenReturn(resultContext);
workerService.consumeRun().accept(message);
verify(notificationService).publishFail(any(), any(), eq("Selected bus is out of voltage"), any(), any(), any());
assertThrows(ComputationException.class, () -> workerService.consumeRun().accept(message));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could keep checking "Selected bus is out of voltage" ?

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants