diff --git a/api/batch/pom.xml b/api/batch/pom.xml index 90c623eb..9500bb5b 100644 --- a/api/batch/pom.xml +++ b/api/batch/pom.xml @@ -4,11 +4,11 @@ rtd-ms-transaction-filter-api it.gov.pagopa.rtd.ms.transaction_filter.api - 2.0.1 + 2.0.2 rtd-ms-transaction-filter-api-batch - 2.0.1 + 2.0.2 @@ -21,7 +21,7 @@ org.bouncycastle - bcpg-jdk15on + bcpg-jdk18on org.hibernate.validator diff --git a/api/batch/src/main/java/it/gov/pagopa/rtd/transaction_filter/batch/step/TransactionFilterStep.java b/api/batch/src/main/java/it/gov/pagopa/rtd/transaction_filter/batch/step/TransactionFilterStep.java index 28279c7d..1e9740c1 100644 --- a/api/batch/src/main/java/it/gov/pagopa/rtd/transaction_filter/batch/step/TransactionFilterStep.java +++ b/api/batch/src/main/java/it/gov/pagopa/rtd/transaction_filter/batch/step/TransactionFilterStep.java @@ -222,6 +222,8 @@ public TransactionFlatFileItemReader transactionItemReader( return flatFileItemReader; } + @Bean + @StepScope public ItemReader mapItemReader(StoreService storeService) { return new CustomIteratorItemReader<>(storeService.getAggregateKeySet()); } @@ -483,7 +485,8 @@ public Step fileReportRecoveryStep(FileReportRestClient restClient) { * @return a itemReader */ @Bean - public ItemReader fileReportReader(FileReportRestClient restClient) { + @StepScope + public FileReportItemReader fileReportReader(FileReportRestClient restClient) { return new FileReportItemReader(restClient); } @@ -494,7 +497,8 @@ public ItemReader fileReportReader(FileReportRestClient restClient */ @SneakyThrows @Bean - public ItemWriter fileReportWriter() { + @StepScope + public FlatFileItemWriter fileReportWriter() { DateTimeFormatter fmt = DateTimeFormatter.ofPattern(DATE_FORMAT_FOR_FILENAME); String currentDate = OffsetDateTime.now().format(fmt); diff --git a/api/batch/src/main/java/it/gov/pagopa/rtd/transaction_filter/batch/step/reader/CustomIteratorItemReader.java b/api/batch/src/main/java/it/gov/pagopa/rtd/transaction_filter/batch/step/reader/CustomIteratorItemReader.java index d74c1bfa..c9f77433 100644 --- a/api/batch/src/main/java/it/gov/pagopa/rtd/transaction_filter/batch/step/reader/CustomIteratorItemReader.java +++ b/api/batch/src/main/java/it/gov/pagopa/rtd/transaction_filter/batch/step/reader/CustomIteratorItemReader.java @@ -2,6 +2,8 @@ import java.util.Iterator; import lombok.Setter; +import org.springframework.batch.core.StepExecution; +import org.springframework.batch.core.annotation.BeforeStep; import org.springframework.batch.item.ItemReader; import org.springframework.lang.Nullable; @@ -14,6 +16,11 @@ public CustomIteratorItemReader(Iterable iterable) { this.iterable = iterable; } + @BeforeStep + public void initializeState(StepExecution stepExecution) { + this.iterator = null; + } + @Nullable public synchronized T read() { if (this.iterator == null) { diff --git a/api/batch/src/main/java/it/gov/pagopa/rtd/transaction_filter/batch/step/reader/FileReportItemReader.java b/api/batch/src/main/java/it/gov/pagopa/rtd/transaction_filter/batch/step/reader/FileReportItemReader.java index 027fd0ef..d220b48e 100644 --- a/api/batch/src/main/java/it/gov/pagopa/rtd/transaction_filter/batch/step/reader/FileReportItemReader.java +++ b/api/batch/src/main/java/it/gov/pagopa/rtd/transaction_filter/batch/step/reader/FileReportItemReader.java @@ -5,22 +5,15 @@ import java.util.Collection; import java.util.Collections; import java.util.Objects; -import org.springframework.batch.core.StepExecution; -import org.springframework.batch.core.annotation.BeforeStep; public class FileReportItemReader extends CustomIteratorItemReader { - private final FileReportRestClient restClient; - public FileReportItemReader(FileReportRestClient restClient) { super(Collections.emptyList()); - this.restClient = restClient; - } - @BeforeStep - public void initializeState(StepExecution stepExecution) { Collection files = Objects.requireNonNull(restClient.getFileReport()) .getFilesRecentlyUploaded(); + if (files != null) { super.setIterable(files); } diff --git a/api/pom.xml b/api/pom.xml index 06f125b7..8f9e16b7 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -4,12 +4,12 @@ rtd-ms-transaction-filter it.gov.pagopa.rtd.ms - 2.0.1 + 2.0.2 it.gov.pagopa.rtd.ms.transaction_filter.api rtd-ms-transaction-filter-api - 2.0.1 + 2.0.2 pom diff --git a/app/pom.xml b/app/pom.xml index 324e053b..b1c20f38 100644 --- a/app/pom.xml +++ b/app/pom.xml @@ -4,12 +4,12 @@ rtd-ms-transaction-filter it.gov.pagopa.rtd.ms - 2.0.1 + 2.0.2 it.gov.pagopa.rtd.ms.transaction_filter transaction-filter-app - 2.0.1 + 2.0.2 diff --git a/app/src/main/resources/config/application.yml b/app/src/main/resources/config/application.yml index 06dddc63..96701a59 100644 --- a/app/src/main/resources/config/application.yml +++ b/app/src/main/resources/config/application.yml @@ -116,7 +116,7 @@ batchConfiguration: rest-client: user-agent: prefix: BatchService - version: 2.0.1 + version: 2.0.2 hpan: serviceCode: hpan-service base-url: ${HPAN_SERVICE_URL:https://bpd-dev.azure-api.net:${HPAN_SERVICE_PORT:443}} diff --git a/core/pom.xml b/core/pom.xml index 34c69657..0bd10d48 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,12 +4,12 @@ rtd-ms-transaction-filter it.gov.pagopa.rtd.ms - 2.0.1 + 2.0.2 it.gov.pagopa.rtd.ms.transaction_filter rtd-ms-transaction-filter-core - 2.0.1 + 2.0.2 diff --git a/integration/jpa/pom.xml b/integration/jpa/pom.xml index be1280a4..58579afd 100644 --- a/integration/jpa/pom.xml +++ b/integration/jpa/pom.xml @@ -4,12 +4,12 @@ rtd-ms-transaction-filter-integration it.gov.pagopa.rtd.ms.transaction_filter - 2.0.1 + 2.0.2 it.gov.pagopa.rtd.ms.transaction_filter.integration rtd-ms-transaction-filter-integration-jpa - 2.0.1 + 2.0.2 diff --git a/integration/pom.xml b/integration/pom.xml index 7a67e98f..7e69c795 100644 --- a/integration/pom.xml +++ b/integration/pom.xml @@ -4,12 +4,12 @@ rtd-ms-transaction-filter it.gov.pagopa.rtd.ms - 2.0.1 + 2.0.2 it.gov.pagopa.rtd.ms.transaction_filter rtd-ms-transaction-filter-integration - 2.0.1 + 2.0.2 pom diff --git a/integration/rest/pom.xml b/integration/rest/pom.xml index cfa94e58..6773736d 100644 --- a/integration/rest/pom.xml +++ b/integration/rest/pom.xml @@ -4,12 +4,12 @@ it.gov.pagopa.rtd.ms.transaction_filter rtd-ms-transaction-filter-integration - 2.0.1 + 2.0.2 it.gov.pagopa.rtd.ms.transaction_filter.integration rtd-ms-transaction-filter-integration-rest - 2.0.1 + 2.0.2 diff --git a/integration/rest/src/test/java/it/gov/pagopa/rtd/transaction_filter/logger/MaskingPatternLayoutTest.java b/integration/rest/src/test/java/it/gov/pagopa/rtd/transaction_filter/logger/MaskingPatternLayoutTest.java index 645c4977..bb0621ec 100644 --- a/integration/rest/src/test/java/it/gov/pagopa/rtd/transaction_filter/logger/MaskingPatternLayoutTest.java +++ b/integration/rest/src/test/java/it/gov/pagopa/rtd/transaction_filter/logger/MaskingPatternLayoutTest.java @@ -38,7 +38,7 @@ void whenLogContainsSaltThenAnonymizeIt(CapturedOutput output) { String stringWithSalt = "[HpanRestConnector#getSalt] ---> GET https://api.dev.cstar.pagopa.it/rtd/payment-instrument-manager/v2/salt HTTP/1.1\n" + "[HpanRestConnector#getSalt] Ocp-Apim-Subscription-Key: ciao\n" - + "[HpanRestConnector#getSalt] User-Agent: BatchService/2.0.1\n" + + "[HpanRestConnector#getSalt] User-Agent: BatchService/2.0.2\n" + "[HpanRestConnector#getSalt] ---> END HTTP (0-byte body)\n" + "[HpanRestConnector#getSalt] <--- HTTP/1.1 200 OK (57ms)\n" + "[HpanRestConnector#getSalt] connection: keep-alive\n" diff --git a/ops_resources/example_config/application.yml b/ops_resources/example_config/application.yml index 12c19841..d24fc364 100644 --- a/ops_resources/example_config/application.yml +++ b/ops_resources/example_config/application.yml @@ -115,7 +115,7 @@ batchConfiguration: rest-client: user-agent: prefix: BatchService - version: 2.0.1 + version: 2.0.2 hpan: serviceCode: hpan-service base-url: ${HPAN_SERVICE_URL:https://bpd-dev.azure-api.net:${HPAN_SERVICE_PORT:443}} diff --git a/ops_resources/example_config/application_hbsql.yml b/ops_resources/example_config/application_hbsql.yml index f86d0386..95fcc4f4 100644 --- a/ops_resources/example_config/application_hbsql.yml +++ b/ops_resources/example_config/application_hbsql.yml @@ -93,7 +93,7 @@ batchConfiguration: rest-client: user-agent: prefix: BatchService - version: 2.0.1 + version: 2.0.2 hpan: serviceCode: hpan-service base-url: ${HPAN_SERVICE_URL:https://bpd-dev.azure-api.net:${HPAN_SERVICE_PORT:443}} diff --git a/pom.xml b/pom.xml index 576005f4..a612af24 100644 --- a/pom.xml +++ b/pom.xml @@ -5,23 +5,23 @@ org.springframework.boot spring-boot-starter-parent - 2.7.4 + 2.7.9 it.gov.pagopa.rtd.ms rtd-ms-transaction-filter - 2.0.1 + 2.0.2 pom 1.8 - 2.7.4 + 2.7.9 42.5.1 3.1.4 1.33 2.11.0 - 1.70 + 1.72.2 2.14.0 3.1.2 3.0.0-M1 @@ -33,7 +33,7 @@ UTF-8 **/enums/**,**/model/**,**/Constants*.java,**/*Config.java,**/*Application.java - 2.0.1 + 2.0.2 @@ -67,7 +67,7 @@ org.bouncycastle - bcpg-jdk15on + bcpg-jdk18on ${bouncycastle.version} @@ -77,6 +77,12 @@ pom import + + + commons-fileupload + commons-fileupload + 1.5 + it.gov.pagopa.rtd.ms.transaction_filter.integration rtd-ms-transaction-filter-integration-jpa