Skip to content

Commit

Permalink
feat: rely on rabbitmq dlq for computation errors handling
Browse files Browse the repository at this point in the history
Signed-off-by: Joris Mancini <joris.mancini_externe@rte-france.com>
  • Loading branch information
TheMaskedTurtle committed Dec 13, 2024
1 parent c0a8b15 commit 714225b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
<dependencyManagement>
<dependencies>
<!-- overrides of imports -->
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-ws-commons</artifactId>
<version>1.19.0-SNAPSHOT</version>
</dependency>
<dependency><!-- To remove when integrate in next release of gridsuite-dependencies or powsybl-ws-dependencies -->
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp-bom</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ public SecurityAnalysisResult run(SecurityAnalysisRunContext runContext) {
runContext.setNetwork(network);
AtomicReference<ReportNode> rootReporter = new AtomicReference<>();
return run(runContext, null, rootReporter);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
return null;
} catch (Exception e) {
LOGGER.error(getFailedMessage(getComputationType()), e);
return null;
Expand Down
19 changes: 15 additions & 4 deletions src/main/resources/config/application.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
spring:
application:
name: security-analysis-server

jpa:
properties:
hibernate:
Expand All @@ -20,6 +20,7 @@ spring:
group: saGroup
consumer:
concurrency: 2
max-attempts: 1
publishRun-out-0:
destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.run
publishResult-out-0:
Expand All @@ -30,11 +31,21 @@ spring:
destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.cancel
publishStopped-out-0:
destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.stopped
publishFailed-out-0:
destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.failed
publishCancelFailed-out-0:
destination: ${powsybl-ws.rabbitmq.destination.prefix:}sa.cancelfailed
output-bindings: publishRun-out-0;publishResult-out-0;publishCancel-out-0;publishStopped-out-0;publishFailed-out-;publishCancelFailed-out-0
rabbit:
bindings:
consumeRun-in-0:
consumer:
auto-bind-dlq: true
dead-letter-exchange: ${powsybl-ws.rabbitmq.destination.prefix:}sa.run.dlx
dead-letter-queue-name: ${powsybl-ws.rabbitmq.destination.prefix:}sa.run.dlx.dlq
dead-letter-exchange-type: topic
quorum:
enabled: true
delivery-limit: 2


powsybl-ws:
database:
Expand Down Expand Up @@ -89,4 +100,4 @@ security-analysis:
- [ 1, 1, 1, 1 ]
- [ 1, 1, 1, 1 ]
- [ 1, 1, 1, 1 ]
- [ 1, 1, 1, 1 ]
- [ 1, 1, 1, 1 ]

0 comments on commit 714225b

Please sign in to comment.