Fixed the double save of summary results when 2 guidelines where checked in parallel

This commit is contained in:
Katerina 2024-04-22 12:49:49 +03:00
parent 1a99c041d3
commit 88bd430801
2 changed files with 2 additions and 5 deletions

View File

@ -32,8 +32,6 @@ public class SumUpNCleanProcessor implements Processor {
@Override
public void process(Exchange exchange) throws Exception {
Thread stop=null;
ValidationJob validationJob = new ValidationJob();
validationJob.id = (Integer)exchange.getIn().getHeader("validationId");
validationJob.baseUrl = (String)(exchange.getIn().getHeader("baseUrl"));

View File

@ -126,6 +126,7 @@ public class FairOaiPmhRoute2 extends RouteBuilder {
.multicast().parallelProcessing()
.to("direct:guidelinesProcessor")
.to("direct:fairProcessor")
.to("controlbus:route?routeId=1&action=stop&async=true")
.endChoice()
.otherwise()
.process(new ErrorProcessor(validationJob))
@ -152,11 +153,10 @@ public class FairOaiPmhRoute2 extends RouteBuilder {
.choice()
.when(header("MyHeader").isEqualTo("stop"))
.process(new SumUpNCleanProcessor(validationJobRepository, validationResultRepository, summaryValidationJobRepository,
profile))
profile))
/*.process(new DataBaseProcessor())
.to("jpa:" + ValidationJob.class.getName() + "?useExecuteUpdate=true")//;.to("direct:saveToDatabase")*/
.to("controlbus:route?routeId="+routeid+"&action=stop&async=true")
.to("controlbus:route?routeId=1&action=stop&async=true")
.endChoice()
.end();
@ -183,7 +183,6 @@ public class FairOaiPmhRoute2 extends RouteBuilder {
/*.process(new DataBaseProcessor())
.to("jpa:" + ValidationJob.class.getName() + "?useExecuteUpdate=true")//;.to("direct:saveToDatabase")*/
.to("controlbus:route?routeId="+routeid2+"&action=stop&async=true")
.to("controlbus:route?routeId=1&action=stop&async=true")
.endChoice()
.end();