diff --git a/src/main/java/fr/agrometinfo/seasonhandler/MainConfiguration.java b/src/main/java/fr/agrometinfo/seasonhandler/MainConfiguration.java index b817343eef815a990a07903dfa9a827363705709..2e5bb96d47d9e1f9ae6822ace616adb629cc90f7 100644 --- a/src/main/java/fr/agrometinfo/seasonhandler/MainConfiguration.java +++ b/src/main/java/fr/agrometinfo/seasonhandler/MainConfiguration.java @@ -80,10 +80,18 @@ public class MainConfiguration { * Initial context factory for ActiveMQ. */ JMS_FACTORY(Context.INITIAL_CONTEXT_FACTORY, false), + /** + * Queue for integration end. + */ + JMS_INTEGRATION_DONE_QUEUE("queue.integrationDoneQueueLookup", false), /** * Queue to listen. */ JMS_SAFRAN_QUEUE("queue.newSafranDataQueueLookup", false), + /** + * Queue for integration end. + */ + JMS_INTEGRATION_DONE_QUEUE("queue.integrationDoneQueueLookup", false), /** * Queue for simulation end. */ diff --git a/src/main/java/fr/agrometinfo/seasonhandler/jms/IntegrationDoneReceiver.java b/src/main/java/fr/agrometinfo/seasonhandler/jms/IntegrationDoneReceiver.java index 6dfacda45ad0e02bb49d9675f990cfedc705695d..2a3f07c9f5278d3f9d464bcdd0491860b2324dc0 100644 --- a/src/main/java/fr/agrometinfo/seasonhandler/jms/IntegrationDoneReceiver.java +++ b/src/main/java/fr/agrometinfo/seasonhandler/jms/IntegrationDoneReceiver.java @@ -59,7 +59,7 @@ public final class IntegrationDoneReceiver implements MessageListener, Runnable final String body = msg.getBody(String.class); LOGGER.info("Body from received message: {}", body); var parsed = LocalDateTime.parse(body); - if (parsed != null && parsed.isAfter(lastDateTime)) { + if (lastDateTime == null || (parsed != null && parsed.isAfter(lastDateTime))) { // empty cache HttpClient client = HttpClient.newHttpClient(); config.getEmptyCacheRestUrls().forEach(url -> { diff --git a/src/test/resources/config-evaluation-not-exists.properties b/src/test/resources/config-evaluation-not-exists.properties index fc126bf33006d957559935b7590845de63020820..63fd8fc76fccb58f8db6470fb8796f04120d9e6c 100644 --- a/src/test/resources/config-evaluation-not-exists.properties +++ b/src/test/resources/config-evaluation-not-exists.properties @@ -13,10 +13,12 @@ java.naming.factory.initial = org.apache.activemq.artemis.jndi.ActiveMQInitialCo # ActiveMQ java.naming.provider.url = tcp://localhost:61616?reconnectAttempts=-1 +queue.integrationDoneQueueLookup = integration-done queue.newSafranDataQueueLookup = agrometinfo-new-safran-data +queue.simulationDoneQueueLookup = simulation-done queue.treatmentQueueLookup = treatment queue.treatement.priority = 6 ## Same as in running SEASON-cli. season.results.table.owner = season -season.results.table.reader = season-read \ No newline at end of file +season.results.table.reader = season-read diff --git a/src/test/resources/config-good-with-stages.properties b/src/test/resources/config-good-with-stages.properties index a250405111b9b4cb87d6b07e00ed0f02872b919c..138d8cfb96ded105fe22d7821bc9a20f00ce68f9 100644 --- a/src/test/resources/config-good-with-stages.properties +++ b/src/test/resources/config-good-with-stages.properties @@ -13,9 +13,10 @@ java.naming.factory.initial = org.apache.activemq.artemis.jndi.ActiveMQInitialCo # ActiveMQ java.naming.provider.url = tcp://localhost:61616?reconnectAttempts=-1 +queue.integrationDoneQueueLookup = integration-done queue.newSafranDataQueueLookup = agrometinfo-new-safran-data -queue.treatmentQueueLookup = treatment queue.simulationDoneQueueLookup = simulation-done +queue.treatmentQueueLookup = treatment queue.treatement.priority = 6 ## Same as in running SEASON-cli. diff --git a/src/test/resources/config-good.properties b/src/test/resources/config-good.properties index d29a0739a242bd719232b1e39e24863257e3609b..1169af92ee3caa8c00ab1eb22c17c141659f72bb 100644 --- a/src/test/resources/config-good.properties +++ b/src/test/resources/config-good.properties @@ -13,9 +13,10 @@ java.naming.factory.initial = org.apache.activemq.artemis.jndi.ActiveMQInitialCo # ActiveMQ java.naming.provider.url = tcp://localhost:61616?reconnectAttempts=-1 +queue.integrationDoneQueueLookup = integration-done queue.newSafranDataQueueLookup = agrometinfo-new-safran-data -queue.treatmentQueueLookup = treatment queue.simulationDoneQueueLookup = simulation-done +queue.treatmentQueueLookup = treatment queue.treatement.priority = 6 ## Same as in running SEASON-cli. diff --git a/src/test/resources/config-invalid-stages.properties b/src/test/resources/config-invalid-stages.properties index 5171ce72740dba7b489735ce17db81dba88e7a45..fc3431afe36fb9adadc4651e1f1d8a5bf7ee8291 100644 --- a/src/test/resources/config-invalid-stages.properties +++ b/src/test/resources/config-invalid-stages.properties @@ -13,11 +13,12 @@ java.naming.factory.initial = org.apache.activemq.artemis.jndi.ActiveMQInitialCo # ActiveMQ java.naming.provider.url = tcp://localhost:61616?reconnectAttempts=-1 +queue.integrationDoneQueueLookup = integration-done queue.newSafranDataQueueLookup = agrometinfo-new-safran-data -queue.treatmentQueueLookup = treatment queue.simulationDoneQueueLookup = simulation-done +queue.treatmentQueueLookup = treatment queue.treatement.priority = 6 ## Same as in running SEASON-cli. season.results.table.owner = season -season.results.table.reader = season-read \ No newline at end of file +season.results.table.reader = season-read diff --git a/src/test/resources/config-simulation-not-exists.properties b/src/test/resources/config-simulation-not-exists.properties index 83784277767fea5ece3926f62c7175277dfe15ce..17285e0d798dde24431c85ca5d306b50011cadf6 100644 --- a/src/test/resources/config-simulation-not-exists.properties +++ b/src/test/resources/config-simulation-not-exists.properties @@ -13,9 +13,10 @@ java.naming.factory.initial = org.apache.activemq.artemis.jndi.ActiveMQInitialCo # ActiveMQ java.naming.provider.url = tcp://localhost:61616?reconnectAttempts=-1 +queue.integrationDoneQueueLookup = integration-done queue.newSafranDataQueueLookup = agrometinfo-new-safran-data -queue.treatmentQueueLookup = treatment queue.simulationDoneQueueLookup = simulation-done +queue.treatmentQueueLookup = treatment queue.treatement.priority = 6 ## Same as in running SEASON-cli.