diff --git a/src/main/java/org/gridsuite/ds/server/service/DynamicSimulationWorkerService.java b/src/main/java/org/gridsuite/ds/server/service/DynamicSimulationWorkerService.java index 1df0e50..c7b2228 100644 --- a/src/main/java/org/gridsuite/ds/server/service/DynamicSimulationWorkerService.java +++ b/src/main/java/org/gridsuite/ds/server/service/DynamicSimulationWorkerService.java @@ -251,8 +251,12 @@ protected void handleNonCancellationException(AbstractResultContext> consumeRun() { + public Consumer> consumeRun1() { + return super.consumeRun(); + } + + @Bean + public Consumer> consumeRun2() { return super.consumeRun(); } diff --git a/src/main/resources/config/application.yaml b/src/main/resources/config/application.yaml index 955fe92..b27a5f9 100644 --- a/src/main/resources/config/application.yaml +++ b/src/main/resources/config/application.yaml @@ -4,15 +4,16 @@ spring: cloud: function: - definition: consumeRun;consumeCancel + definition: consumeRun1;consumeRun2;consumeCancel stream: bindings: - consumeRun-in-0: + consumeRun1-in-0: &consumeRunConfig destination: ${powsybl-ws.rabbitmq.destination.prefix:}ds.run group: dsGroup consumer: - concurrency: 2 max-attempts: 1 + consumeRun2-in-0: + <<: *consumeRunConfig publishRun-out-0: destination: ${powsybl-ws.rabbitmq.destination.prefix:}ds.run publishDebug-out-0: @@ -30,7 +31,7 @@ spring: output-bindings: publishRun-out-0;publishDebug-out-0;publishResult-out-0;publishCancel-out-0;publishStopped-out-0;publishCancelFailed-out-0 rabbit: bindings: - consumeRun-in-0: + consumeRun1-in-0: &consumeRunRabbitConfig consumer: auto-bind-dlq: true dead-letter-exchange: ${powsybl-ws.rabbitmq.destination.prefix:}ds.run.dlx @@ -39,6 +40,8 @@ spring: quorum: enabled: true delivery-limit: 2 + consumeRun2-in-0: + <<: *consumeRunRabbitConfig computation: s3: enabled: true diff --git a/src/test/resources/application-default.yml b/src/test/resources/application-default.yml index e3e509b..4e9c321 100644 --- a/src/test/resources/application-default.yml +++ b/src/test/resources/application-default.yml @@ -4,6 +4,10 @@ spring: properties: dialect: org.hibernate.dialect.H2Dialect hibernate.format_sql: true + cloud: + function: + # disable consumeRun2 during test - all of them receive the "dsGroup" messages otherwise + definition: consumeRun1;consumeCancel logging: level: