From ecba23056155cdcfae39802ef1f08b57f8816011 Mon Sep 17 00:00:00 2001 From: Francesco Parisi Date: Thu, 28 Mar 2024 11:36:11 +0100 Subject: [PATCH 01/32] fix db connection problems --- helm/values-dev.yaml | 3 +++ helm/values-prod.yaml | 3 +++ helm/values-uat.yaml | 3 +++ src/main/resources/application-local.yaml | 2 +- src/main/resources/application.yaml | 6 +++--- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 13c6950..c0cfc85 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -67,6 +67,9 @@ microservice-chart: APP_LOGGING_LEVEL: 'INFO' DEFAULT_LOGGING_LEVEL: 'INFO' CORS_CONFIGURATION: '{"origins": ["*"], "methods": ["*"]}' + DB_CONNECTION_TIMEOUT: 15000 + DB_MAX_LIFETIME: 20000 + DB_KEEPALIVE_TIME: 30000 DB_NEXI_POSTGRES_URL: "jdbc:postgresql://db-postgres-ndp.d.db-nodo-pagamenti.com:5444/ndpspct?prepareThreshold=0¤tSchema=NODO4_CFG" DB_NEXI_POSTGRES_USER: "pp_nodo4_cfg" DB_NEXI_POSTGRES_ENABLED: "false" diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 91719cd..415fb1d 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -67,6 +67,9 @@ microservice-chart: APP_LOGGING_LEVEL: 'INFO' DEFAULT_LOGGING_LEVEL: 'INFO' CORS_CONFIGURATION: '{"origins": ["*"], "methods": ["*"]}' + DB_CONNECTION_TIMEOUT: 15000 + DB_MAX_LIFETIME: 20000 + DB_KEEPALIVE_TIME: 30000 DB_NEXI_POSTGRES_URL: "jdbc:postgresql://db-postgres-ndp.p.db-nodo-pagamenti.com:5444/ndpspcp?prepareThreshold=0¤tSchema=NODO4_CFG" DB_NEXI_POSTGRES_USER: "pp_nodo4_cfg" DB_NEXI_POSTGRES_ENABLED: "false" diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index ce642c7..6ad60ac 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -67,6 +67,9 @@ microservice-chart: APP_LOGGING_LEVEL: 'INFO' DEFAULT_LOGGING_LEVEL: 'INFO' CORS_CONFIGURATION: '{"origins": ["*"], "methods": ["*"]}' + DB_CONNECTION_TIMEOUT: 15000 + DB_MAX_LIFETIME: 20000 + DB_KEEPALIVE_TIME: 30000 DB_NEXI_POSTGRES_URL: "jdbc:postgresql://db-postgres-ndp.u.db-nodo-pagamenti.com:5444/ndpspca?prepareThreshold=0¤tSchema=NODO4_CFG" DB_NEXI_POSTGRES_USER: "pp_nodo4_cfg" DB_NEXI_POSTGRES_ENABLED: "false" diff --git a/src/main/resources/application-local.yaml b/src/main/resources/application-local.yaml index fc32322..c7dfe84 100644 --- a/src/main/resources/application-local.yaml +++ b/src/main/resources/application-local.yaml @@ -14,7 +14,7 @@ spring: datasource: hikari: connectionTimeout: 15000 - maxLifetime: 30000 + maxLifetime: 20000 keepaliveTime: 30000 connection-test-query: select 1 pagopa: diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 243c1b7..d44af35 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -41,9 +41,9 @@ app: spring: datasource: hikari: - connectionTimeout: 15000 - maxLifetime: 30000 - keepaliveTime: 30000 + connectionTimeout: ${DB_CONNECTION_TIMEOUT} + maxLifetime: ${DB_MAX_LIFETIME} + keepaliveTime: ${DB_KEEPALIVE_TIME} pagopa: postgres: url: ${DB_PAGOPA_POSTGRES_URL} From d1057ae2528490e47efe40078cd34ade89cf2019 Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Thu, 28 Mar 2024 10:37:47 +0000 Subject: [PATCH 02/32] Bump to version 0.0.1-6-fix-problems [skip ci] --- helm/Chart.yaml | 4 ++-- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- openapi/openapi.json | 2 +- pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index ff53b94..e18f506 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-afm-calculator description: Microservice that handles calculation for pagoPA Advanced Fees Management type: application -version: 0.40.0 -appVersion: 0.0.1-5-NOD-745-coverage-80-unit-test +version: 0.41.0 +appVersion: 0.0.1-6-fix-problems dependencies: - name: microservice-chart version: 2.8.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index c0cfc85..3380335 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-5-NOD-745-coverage-80-unit-test" + tag: "0.0.1-6-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 415fb1d..33eb717 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-5-NOD-745-coverage-80-unit-test" + tag: "0.0.1-6-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 6ad60ac..033bed3 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-5-NOD-745-coverage-80-unit-test" + tag: "0.0.1-6-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi/openapi.json b/openapi/openapi.json index fa6d1d3..df9ccd1 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "title": "cfg-sync", "description": "Microservice to update configuration schema of Nodo dei Pagamenti", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.0.1-5-NOD-745-coverage-80-unit-test" + "version": "0.0.1-6-fix-problems" }, "servers": [ { diff --git a/pom.xml b/pom.xml index dfd9acb..5e53479 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ it.gov.pagopa.node cfg-sync - 0.0.1-5-NOD-745-coverage-80-unit-test + 0.0.1-6-fix-problems Microservice to update configuration schema of Nodo dei Pagamenti From e9859d136b8a7ebb16488e4f34e7c726acb107a8 Mon Sep 17 00:00:00 2001 From: Francesco Parisi Date: Thu, 28 Mar 2024 12:00:02 +0100 Subject: [PATCH 03/32] fix db connection problems --- src/main/resources/application.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index d44af35..85f13cc 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -40,10 +40,6 @@ app: spring: datasource: - hikari: - connectionTimeout: ${DB_CONNECTION_TIMEOUT} - maxLifetime: ${DB_MAX_LIFETIME} - keepaliveTime: ${DB_KEEPALIVE_TIME} pagopa: postgres: url: ${DB_PAGOPA_POSTGRES_URL} @@ -52,6 +48,9 @@ spring: ##permette di abilitare/disabilitare il datasource al db Postgres PagoPA enabled: ${DB_PAGOPA_POSTGRES_ENABLED:'false'} connection-test-query: select 1 + connectionTimeout: ${DB_CONNECTION_TIMEOUT} + maxLifetime: ${DB_MAX_LIFETIME} + keepaliveTime: ${DB_KEEPALIVE_TIME} nexi: oracle: url: ${DB_NEXI_ORACLE_URL} @@ -60,6 +59,9 @@ spring: ##permette di abilitare/disabilitare il datasource al db Oracle Nexi enabled: ${DB_NEXI_ORACLE_ENABLED:'false'} connection-test-query: select 1 from dual + connectionTimeout: ${DB_CONNECTION_TIMEOUT} + maxLifetime: ${DB_MAX_LIFETIME} + keepaliveTime: ${DB_KEEPALIVE_TIME} postgres: url: ${DB_NEXI_POSTGRES_URL} username: ${DB_NEXI_POSTGRES_USER} @@ -67,6 +69,9 @@ spring: ##permette di abilitare/disabilitare il datasource al db Postgres Nexi enabled: ${DB_NEXI_POSTGRES_ENABLED:'false'} connection-test-query: select 1 + connectionTimeout: ${DB_CONNECTION_TIMEOUT} + maxLifetime: ${DB_MAX_LIFETIME} + keepaliveTime: ${DB_KEEPALIVE_TIME} jpa: show-sql: 'false' From f7ecca5bb3e879520a76c8e6ad1dc19f6c937c24 Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Thu, 28 Mar 2024 11:01:15 +0000 Subject: [PATCH 04/32] Bump to version 0.0.1-7-fix-problems [skip ci] --- helm/Chart.yaml | 4 ++-- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- openapi/openapi.json | 2 +- pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index e18f506..53692ec 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-afm-calculator description: Microservice that handles calculation for pagoPA Advanced Fees Management type: application -version: 0.41.0 -appVersion: 0.0.1-6-fix-problems +version: 0.42.0 +appVersion: 0.0.1-7-fix-problems dependencies: - name: microservice-chart version: 2.8.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 3380335..9713279 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-6-fix-problems" + tag: "0.0.1-7-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 33eb717..72d8f2b 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-6-fix-problems" + tag: "0.0.1-7-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 033bed3..7f84217 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-6-fix-problems" + tag: "0.0.1-7-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi/openapi.json b/openapi/openapi.json index df9ccd1..ca874d0 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "title": "cfg-sync", "description": "Microservice to update configuration schema of Nodo dei Pagamenti", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.0.1-6-fix-problems" + "version": "0.0.1-7-fix-problems" }, "servers": [ { diff --git a/pom.xml b/pom.xml index 5e53479..08d89e5 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ it.gov.pagopa.node cfg-sync - 0.0.1-6-fix-problems + 0.0.1-7-fix-problems Microservice to update configuration schema of Nodo dei Pagamenti From 405513420b12c2a1e9ef8959623196c42c0e58de Mon Sep 17 00:00:00 2001 From: Francesco Parisi Date: Thu, 28 Mar 2024 12:42:24 +0100 Subject: [PATCH 05/32] fix log + Hikari params --- helm/values-dev.yaml | 3 ++- helm/values-prod.yaml | 1 + helm/values-uat.yaml | 1 + .../service/ApiConfigCacheEhConsumer.java | 6 +++--- .../cfgsync/service/ApiConfigCacheService.java | 17 ++++++++--------- .../service/StandInManagerEhConsumer.java | 6 +++--- .../cfgsync/service/StandInManagerService.java | 18 +++++++++--------- src/main/resources/application.yaml | 3 +++ 8 files changed, 30 insertions(+), 25 deletions(-) diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 9713279..6c77ca8 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -65,10 +65,11 @@ microservice-chart: WEBSITE_SITE_NAME: 'pagopa-node-cfg-sync' ENV: 'azure-dev' APP_LOGGING_LEVEL: 'INFO' + HIKARI_LOGGING_LEVEL: 'DEBUG' DEFAULT_LOGGING_LEVEL: 'INFO' CORS_CONFIGURATION: '{"origins": ["*"], "methods": ["*"]}' DB_CONNECTION_TIMEOUT: 15000 - DB_MAX_LIFETIME: 20000 + DB_MAX_LIFETIME: 30000 DB_KEEPALIVE_TIME: 30000 DB_NEXI_POSTGRES_URL: "jdbc:postgresql://db-postgres-ndp.d.db-nodo-pagamenti.com:5444/ndpspct?prepareThreshold=0¤tSchema=NODO4_CFG" DB_NEXI_POSTGRES_USER: "pp_nodo4_cfg" diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 72d8f2b..e97788d 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -65,6 +65,7 @@ microservice-chart: WEBSITE_SITE_NAME: 'pagopa-node-cfg-sync' # required to show cloud role name in application insights ENV: 'azure-prod' APP_LOGGING_LEVEL: 'INFO' + HIKARI_LOGGING_LEVEL: 'INFO' DEFAULT_LOGGING_LEVEL: 'INFO' CORS_CONFIGURATION: '{"origins": ["*"], "methods": ["*"]}' DB_CONNECTION_TIMEOUT: 15000 diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 7f84217..7cbd55a 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -65,6 +65,7 @@ microservice-chart: WEBSITE_SITE_NAME: 'pagopa-node-cfg-sync' ENV: 'azure-uat' APP_LOGGING_LEVEL: 'INFO' + HIKARI_LOGGING_LEVEL: 'INFO' DEFAULT_LOGGING_LEVEL: 'INFO' CORS_CONFIGURATION: '{"origins": ["*"], "methods": ["*"]}' DB_CONNECTION_TIMEOUT: 15000 diff --git a/src/main/java/it/gov/pagopa/node/cfgsync/service/ApiConfigCacheEhConsumer.java b/src/main/java/it/gov/pagopa/node/cfgsync/service/ApiConfigCacheEhConsumer.java index 134677a..5f169e7 100644 --- a/src/main/java/it/gov/pagopa/node/cfgsync/service/ApiConfigCacheEhConsumer.java +++ b/src/main/java/it/gov/pagopa/node/cfgsync/service/ApiConfigCacheEhConsumer.java @@ -50,16 +50,16 @@ public void post(){ } public void processEvent(EventContext eventContext) { - log.info("[NODE-CFG-SYNC] Processing event {} from partition {} with sequence number {} with body: {}", + log.info("[{}] Processing event from partition {} with sequence number {} with body: {}", TargetRefreshEnum.cache.label, eventContext.getPartitionContext().getPartitionId(), eventContext.getEventData().getSequenceNumber(), eventContext.getEventData().getBodyAsString()); Map syncStatusEnumMap = apiConfigCacheService.syncCache(); - log.info("[NODE-CFG-SYNC][ALARM] Processed event {}: {}", TargetRefreshEnum.cache.label, syncStatusEnumMap.toString()); + log.info("[{}][ALERT] Processed event: {}", TargetRefreshEnum.cache.label, syncStatusEnumMap.toString()); } public void processError(ErrorContext errorContext) { - log.error("[NODE-CFG-SYNC][ALERT] Error occurred for {} from partition {}: {}", + log.error("[{}][ALERT] Error occurred from partition {}: {}", TargetRefreshEnum.cache.label, errorContext.getPartitionContext().getPartitionId(), errorContext.getThrowable().getMessage(), diff --git a/src/main/java/it/gov/pagopa/node/cfgsync/service/ApiConfigCacheService.java b/src/main/java/it/gov/pagopa/node/cfgsync/service/ApiConfigCacheService.java index 2987ac5..bca725b 100644 --- a/src/main/java/it/gov/pagopa/node/cfgsync/service/ApiConfigCacheService.java +++ b/src/main/java/it/gov/pagopa/node/cfgsync/service/ApiConfigCacheService.java @@ -76,24 +76,23 @@ public Map syncCache() { if( !apiConfigCacheServiceEnabled) { throw new AppException(AppError.SERVICE_DISABLED, TargetRefreshEnum.cache.label); } - log.debug("[NODE-CFG-SYNC] get cache"); Response response = apiConfigCacheClient.getCache(apiConfigCacheSubscriptionKey); int httpResponseCode = response.status(); if (httpResponseCode != HttpStatus.OK.value()) { - log.error("[NODE-CFG-SYNC] cache error - result: httpStatusCode[{}]", httpResponseCode); + log.error("[{}] error - result: httpStatusCode[{}]", TargetRefreshEnum.cache.label, httpResponseCode); throw new AppException(AppError.INTERNAL_SERVER_ERROR); } Map> headers = response.headers(); if( headers.isEmpty() ) { - log.error("[NODE-CFG-SYNC] cache error - empty header"); + log.error("[{}] response error - empty header", TargetRefreshEnum.cache.label); throw new AppException(AppError.INTERNAL_SERVER_ERROR); } String cacheId = (String) getHeaderParameter(TargetRefreshEnum.cache.label, headers, HEADER_CACHE_ID); String cacheTimestamp = (String) getHeaderParameter(TargetRefreshEnum.cache.label, headers, HEADER_CACHE_TIMESTAMP); String cacheVersion = (String) getHeaderParameter(TargetRefreshEnum.cache.label, headers, HEADER_CACHE_VERSION); - log.info("[NODE-CFG-SYNC] cache successful. cacheId:[{}], cacheTimestamp:[{}], cacheVersion:[{}]", cacheId, Instant.from(ZonedDateTime.parse(cacheTimestamp)), cacheVersion); + log.info("[{}] response successful. cacheId:[{}], cacheTimestamp:[{}], cacheVersion:[{}]", TargetRefreshEnum.cache.label, cacheId, Instant.from(ZonedDateTime.parse(cacheTimestamp)), cacheVersion); ConfigCache configCache = composeCache(cacheId, ZonedDateTime.parse(cacheTimestamp), cacheVersion, response.body().asInputStream().readAllBytes()); @@ -103,12 +102,12 @@ public Map syncCache() { return composeSyncStatusMapResult(syncStatusMap); } catch (FeignException fEx) { - log.error("[NODE-CFG-SYNC] cache error: {}", fEx.getMessage(), fEx); + log.error("[{}] error: {}", TargetRefreshEnum.cache.label, fEx.getMessage(), fEx); throw new AppException(AppError.INTERNAL_SERVER_ERROR); } catch(AppException appException) { throw appException; } catch (Exception ex) { - log.error("[NODE-CFG-SYNC] cache error: {}", ex.getMessage(), ex); + log.error("[{}] error: {}", TargetRefreshEnum.cache.label, ex.getMessage(), ex); throw new AppException(AppError.INTERNAL_SERVER_ERROR); } } @@ -122,7 +121,7 @@ private void savePagoPA(Map syncStatusMap, ConfigCache c syncStatusMap.put(getPagopaPostgresServiceIdentifier(), SyncStatusEnum.DISABLED); } } catch(Exception ex) { - log.error("[NODE-CFG-SYNC][ALERT] Problem to dump cache on PagoPA PostgreSQL: {}", ex.getMessage(), ex); + log.error("[{}][ALERT] Problem to dump cache on PagoPA PostgreSQL: {}", TargetRefreshEnum.cache.label, ex.getMessage(), ex); syncStatusMap.put(getPagopaPostgresServiceIdentifier(), SyncStatusEnum.ERROR); } } @@ -136,7 +135,7 @@ private void saveNexiOracle(Map syncStatusMap, ConfigCac syncStatusMap.put(getNexiOracleServiceIdentifier(), SyncStatusEnum.DISABLED); } } catch(Exception ex) { - log.error("[NODE-CFG-SYNC][ALERT] Problem to dump cache on Nexi Oracle: {}", ex.getMessage(), ex); + log.error("[{}][ALERT] Problem to dump cache on Nexi Oracle: {}", TargetRefreshEnum.cache.label, ex.getMessage(), ex); syncStatusMap.put(getNexiOracleServiceIdentifier(), SyncStatusEnum.ERROR); } } @@ -150,7 +149,7 @@ private void saveNexiPostgres(Map syncStatusMap, ConfigC syncStatusMap.put(getNexiPostgresServiceIdentifier(), SyncStatusEnum.DISABLED); } } catch(Exception ex) { - log.error("[NODE-CFG-SYNC][ALERT] Problem to dump cache on Nexi PostgreSQL: {}", ex.getMessage(), ex); + log.error("[{}][ALERT] Problem to dump cache on Nexi PostgreSQL: {}", TargetRefreshEnum.cache.label, ex.getMessage(), ex); syncStatusMap.put(getNexiPostgresServiceIdentifier(), SyncStatusEnum.ERROR); } } diff --git a/src/main/java/it/gov/pagopa/node/cfgsync/service/StandInManagerEhConsumer.java b/src/main/java/it/gov/pagopa/node/cfgsync/service/StandInManagerEhConsumer.java index 7fc6410..adb95a7 100644 --- a/src/main/java/it/gov/pagopa/node/cfgsync/service/StandInManagerEhConsumer.java +++ b/src/main/java/it/gov/pagopa/node/cfgsync/service/StandInManagerEhConsumer.java @@ -50,16 +50,16 @@ public void post(){ } public void processEvent(EventContext eventContext) { - log.info("[NODE-CFG-SYNC] Processing event {} from partition {} with sequence number {} with body: {}", + log.info("[{}] Processing event from partition {} with sequence number {} with body: {}", TargetRefreshEnum.standin.label, eventContext.getPartitionContext().getPartitionId(), eventContext.getEventData().getSequenceNumber(), eventContext.getEventData().getBodyAsString()); Map syncStatusEnumMap = standInManagerService.syncStandIn(); - log.info("[NODE-CFG-SYNC][ALARM] Processed event {}: {}", TargetRefreshEnum.standin.label, syncStatusEnumMap.toString()); + log.info("[{}][ALERT] Processed event: {}", TargetRefreshEnum.standin.label, syncStatusEnumMap.toString()); } public void processError(ErrorContext errorContext) { - log.error("[NODE-CFG-SYNC][ALERT] Error occurred for {} from partition {}: {}", + log.error("[{}][ALERT] Error occurred from partition {}: {}", TargetRefreshEnum.standin.label, errorContext.getPartitionContext().getPartitionId(), errorContext.getThrowable().getMessage(), diff --git a/src/main/java/it/gov/pagopa/node/cfgsync/service/StandInManagerService.java b/src/main/java/it/gov/pagopa/node/cfgsync/service/StandInManagerService.java index 92a4576..09de606 100644 --- a/src/main/java/it/gov/pagopa/node/cfgsync/service/StandInManagerService.java +++ b/src/main/java/it/gov/pagopa/node/cfgsync/service/StandInManagerService.java @@ -25,6 +25,8 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.PostConstruct; +import java.time.Instant; +import java.time.ZonedDateTime; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -76,17 +78,15 @@ public Map syncStandIn() { if( !standInManagerEnabled) { throw new AppException(AppError.SERVICE_DISABLED, TargetRefreshEnum.standin.label); } - log.debug("[NODE-CFG-SYNC] stations"); Response response = standInManagerClient.getCache(standInManagerSubscriptionKey); int httpResponseCode = response.status(); if (httpResponseCode != HttpStatus.OK.value()) { - log.error("[NODE-CFG-SYNC] stations error - result: httpStatusCode[{}]", httpResponseCode); + log.error("[{}] error - result: httpStatusCode[{}]", TargetRefreshEnum.standin.label, httpResponseCode); throw new AppException(AppError.INTERNAL_SERVER_ERROR); } - log.info("[NODE-CFG-SYNC] stations successful"); StationsResponse stations = objectMapper.readValue(response.body().asInputStream().readAllBytes(), StationsResponse.class); - log.info("[NODE-CFG-SYNC] {} stations found", stations.getStations().size()); + log.info("[{}] response successful. {} stations found", TargetRefreshEnum.standin.label, stations.getStations().size()); List stationsEntities = stations.getStations().stream().map(StandInStations::new).toList(); savePagoPA(syncStatusMap, stationsEntities); @@ -95,12 +95,12 @@ public Map syncStandIn() { return composeSyncStatusMapResult(syncStatusMap); } catch (FeignException fEx) { - log.error("[NODE-CFG-SYNC] {} get cache error: {}", TargetRefreshEnum.standin.label, fEx.getMessage(), fEx); + log.error("[{}] error: {}", TargetRefreshEnum.standin.label, fEx.getMessage(), fEx); throw new AppException(AppError.INTERNAL_SERVER_ERROR); } catch(AppException appException) { throw appException; } catch (Exception ex) { - log.error("[NODE-CFG-SYNC] {} get cache error: {}", TargetRefreshEnum.standin.label, ex.getMessage(), ex); + log.error("[{}] error: {}", TargetRefreshEnum.standin.label, ex.getMessage(), ex); throw new AppException(AppError.INTERNAL_SERVER_ERROR); } } @@ -114,7 +114,7 @@ private void savePagoPA(Map syncStatusMap, List syncStatusMap, List syncStatusMap, List Date: Thu, 28 Mar 2024 16:15:50 +0100 Subject: [PATCH 06/32] fix log + Hikari params --- helm/values-dev.yaml | 14 ++++++++++---- helm/values-prod.yaml | 12 +++++++++--- helm/values-uat.yaml | 12 +++++++++--- src/main/resources/application.yaml | 18 +++++++++--------- 4 files changed, 37 insertions(+), 19 deletions(-) diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 6c77ca8..029785e 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -65,24 +65,30 @@ microservice-chart: WEBSITE_SITE_NAME: 'pagopa-node-cfg-sync' ENV: 'azure-dev' APP_LOGGING_LEVEL: 'INFO' - HIKARI_LOGGING_LEVEL: 'DEBUG' + HIKARI_LOGGING_LEVEL: 'INFO' DEFAULT_LOGGING_LEVEL: 'INFO' CORS_CONFIGURATION: '{"origins": ["*"], "methods": ["*"]}' - DB_CONNECTION_TIMEOUT: 15000 - DB_MAX_LIFETIME: 30000 - DB_KEEPALIVE_TIME: 30000 DB_NEXI_POSTGRES_URL: "jdbc:postgresql://db-postgres-ndp.d.db-nodo-pagamenti.com:5444/ndpspct?prepareThreshold=0¤tSchema=NODO4_CFG" DB_NEXI_POSTGRES_USER: "pp_nodo4_cfg" DB_NEXI_POSTGRES_ENABLED: "false" DB_NEXI_POSTGRES_SERVICE_IDENTIFIER: "NDP004DEV" + DB_NEXI_POSTGRES_CONNECTION_TIMEOUT: 15000 + DB_NEXI_POSTGRES_MAX_LIFETIME: 30000 + DB_NEXI_POSTGRES_KEEPALIVE_TIME: 30000 DB_NEXI_ORACLE_URL: "jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS=(PROTOCOL=tcp)(PORT=1522)(HOST=db-nodo-pagamenti.d.db-nodo-pagamenti.com))(CONNECT_DATA=(SERVICE_NAME=NDPSPCT_PP_NODO4_CFG))(SO_KEEPALIVE=true)(TCP_KEEPIDLE=60)(TCP_KEEPINTVL=30)(TCP_KEEPCNT=15))" DB_NEXI_ORACLE_USER: "NODO4_CFG" DB_NEXI_ORACLE_ENABLED: "true" DB_NEXI_ORACLE_SERVICE_IDENTIFIER: "NDP003DEV" + DB_NEXI_ORACLE_CONNECTION_TIMEOUT: 15000 + DB_NEXI_ORACLE_MAX_LIFETIME: 30000 + DB_NEXI_ORACLE_KEEPALIVE_TIME: 30000 DB_PAGOPA_POSTGRES_URL: "jdbc:postgresql://ndp.d.db-nodo-pagamenti.com:6432/nodo?sslmode=require&prepareThreshold=0¤tSchema=cfg" DB_PAGOPA_POSTGRES_USER: "cfg" DB_PAGOPA_POSTGRES_ENABLED: "true" DB_PAGOPA_POSTGRES_SERVICE_IDENTIFIER: "NDP001DEV" + DB_PAGOPA_POSTGRES_CONNECTION_TIMEOUT: 15000 + DB_PAGOPA_POSTGRES_MAX_LIFETIME: 30000 + DB_PAGOPA_POSTGRES_KEEPALIVE_TIME: 30000 API_CONFIG_CACHE_URL: "https://api.dev.platform.pagopa.it/api-config-cache/o/v1/stakeholders/node/cache/schemas/v1" STAND_IN_MANAGER_URL: "https://api.dev.platform.pagopa.it/stand-in-manager/api/v1" OTEL_SERVICE_NAME: "pagopanodecfgsync" diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index e97788d..b25501c 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -68,21 +68,27 @@ microservice-chart: HIKARI_LOGGING_LEVEL: 'INFO' DEFAULT_LOGGING_LEVEL: 'INFO' CORS_CONFIGURATION: '{"origins": ["*"], "methods": ["*"]}' - DB_CONNECTION_TIMEOUT: 15000 - DB_MAX_LIFETIME: 20000 - DB_KEEPALIVE_TIME: 30000 DB_NEXI_POSTGRES_URL: "jdbc:postgresql://db-postgres-ndp.p.db-nodo-pagamenti.com:5444/ndpspcp?prepareThreshold=0¤tSchema=NODO4_CFG" DB_NEXI_POSTGRES_USER: "pp_nodo4_cfg" DB_NEXI_POSTGRES_ENABLED: "false" DB_NEXI_POSTGRES_SERVICE_IDENTIFIER: "NDP004DEV" + DB_NEXI_POSTGRES_CONNECTION_TIMEOUT: 15000 + DB_NEXI_POSTGRES_MAX_LIFETIME: 30000 + DB_NEXI_POSTGRES_KEEPALIVE_TIME: 30000 DB_CONFIG_URL: "jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS=(PROTOCOL=tcp)(PORT=1521)(HOST=db-nodo-pagamenti.p.db-nodo-pagamenti.com))(CONNECT_DATA=(SERVICE_NAME=NDPSPCP_NODO4_CFG))(SO_KEEPALIVE=true)(TCP_KEEPIDLE=60)(TCP_KEEPINTVL=30)(TCP_KEEPCNT=15))" DB_NEXI_ORACLE_USER: "NODO4_CFG" DB_NEXI_ORACLE_ENABLED: "true" DB_NEXI_ORACLE_SERVICE_IDENTIFIER: "NDP003DEV" + DB_NEXI_ORACLE_CONNECTION_TIMEOUT: 15000 + DB_NEXI_ORACLE_MAX_LIFETIME: 30000 + DB_NEXI_ORACLE_KEEPALIVE_TIME: 30000 DB_PAGOPA_POSTGRES_URL: "jdbc:postgresql://ndp.p.db-nodo-pagamenti.com:6432/nodo?sslmode=require&prepareThreshold=0¤tSchema=cfg" DB_PAGOPA_POSTGRES_USER: "cfg" DB_PAGOPA_POSTGRES_ENABLED: "true" DB_PAGOPA_POSTGRES_SERVICE_IDENTIFIER: "NDP001DEV" + DB_PAGOPA_POSTGRES_CONNECTION_TIMEOUT: 15000 + DB_PAGOPA_POSTGRES_MAX_LIFETIME: 30000 + DB_PAGOPA_POSTGRES_KEEPALIVE_TIME: 30000 API_CONFIG_CACHE_URL: "https://api.uat.platform.pagopa.it/api-config-cache/o/v1/stakeholders/node/cache/schemas/v1" STAND_IN_MANAGER_URL: "https://api.uat.platform.pagopa.it/stand-in-manager/api/v1" OTEL_SERVICE_NAME: "pagopanodecfgsync" diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 7cbd55a..0697fa0 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -68,21 +68,27 @@ microservice-chart: HIKARI_LOGGING_LEVEL: 'INFO' DEFAULT_LOGGING_LEVEL: 'INFO' CORS_CONFIGURATION: '{"origins": ["*"], "methods": ["*"]}' - DB_CONNECTION_TIMEOUT: 15000 - DB_MAX_LIFETIME: 20000 - DB_KEEPALIVE_TIME: 30000 DB_NEXI_POSTGRES_URL: "jdbc:postgresql://db-postgres-ndp.u.db-nodo-pagamenti.com:5444/ndpspca?prepareThreshold=0¤tSchema=NODO4_CFG" DB_NEXI_POSTGRES_USER: "pp_nodo4_cfg" DB_NEXI_POSTGRES_ENABLED: "false" DB_NEXI_POSTGRES_SERVICE_IDENTIFIER: "NDP004DEV" + DB_NEXI_POSTGRES_CONNECTION_TIMEOUT: 15000 + DB_NEXI_POSTGRES_MAX_LIFETIME: 30000 + DB_NEXI_POSTGRES_KEEPALIVE_TIME: 30000 DB_CONFIG_URL: "jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS=(PROTOCOL=tcp)(PORT=1524)(HOST=db-nodo-pagamenti.u.db-nodo-pagamenti.com))(CONNECT_DATA=(SERVICE_NAME=NDPSPCA_NODO4_CFG))(SO_KEEPALIVE=true)(TCP_KEEPIDLE=60)(TCP_KEEPINTVL=30)(TCP_KEEPCNT=15))" DB_NEXI_ORACLE_USER: "NODO4_CFG" DB_NEXI_ORACLE_ENABLED: "true" DB_NEXI_ORACLE_SERVICE_IDENTIFIER: "NDP003DEV" + DB_NEXI_ORACLE_CONNECTION_TIMEOUT: 15000 + DB_NEXI_ORACLE_MAX_LIFETIME: 30000 + DB_NEXI_ORACLE_KEEPALIVE_TIME: 30000 DB_PAGOPA_POSTGRES_URL: "jdbc:postgresql://ndp.u.db-nodo-pagamenti.com:6432/nodo?sslmode=require&prepareThreshold=0¤tSchema=cfg" DB_PAGOPA_POSTGRES_USER: "cfg" DB_PAGOPA_POSTGRES_ENABLED: "true" DB_PAGOPA_POSTGRES_SERVICE_IDENTIFIER: "NDP001DEV" + DB_PAGOPA_POSTGRES_CONNECTION_TIMEOUT: 15000 + DB_PAGOPA_POSTGRES_MAX_LIFETIME: 30000 + DB_PAGOPA_POSTGRES_KEEPALIVE_TIME: 30000 API_CONFIG_CACHE_URL: "https://api.uat.platform.pagopa.it/api-config-cache/o/v1/stakeholders/node/cache/schemas/v1" STAND_IN_MANAGER_URL: "https://api.uat.platform.pagopa.it/stand-in-manager/api/v1" OTEL_SERVICE_NAME: "pagopanodecfgsync" diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index e4aacd1..144d703 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -48,9 +48,9 @@ spring: ##permette di abilitare/disabilitare il datasource al db Postgres PagoPA enabled: ${DB_PAGOPA_POSTGRES_ENABLED:'false'} connection-test-query: select 1 - connectionTimeout: ${DB_CONNECTION_TIMEOUT} - maxLifetime: ${DB_MAX_LIFETIME} - keepaliveTime: ${DB_KEEPALIVE_TIME} + connectionTimeout: ${DB_PAGOPA_POSTGRES_CONNECTION_TIMEOUT} + maxLifetime: ${DB_PAGOPA_POSTGRES_MAX_LIFETIME} + keepaliveTime: ${DB_PAGOPA_POSTGRES_KEEPALIVE_TIME} nexi: oracle: url: ${DB_NEXI_ORACLE_URL} @@ -59,9 +59,9 @@ spring: ##permette di abilitare/disabilitare il datasource al db Oracle Nexi enabled: ${DB_NEXI_ORACLE_ENABLED:'false'} connection-test-query: select 1 from dual - connectionTimeout: ${DB_CONNECTION_TIMEOUT} - maxLifetime: ${DB_MAX_LIFETIME} - keepaliveTime: ${DB_KEEPALIVE_TIME} + connectionTimeout: ${DB_NEXI_ORACLE_CONNECTION_TIMEOUT} + maxLifetime: ${DB_NEXI_ORACLE_MAX_LIFETIME} + keepaliveTime: ${DB_NEXI_ORACLE_KEEPALIVE_TIME} postgres: url: ${DB_NEXI_POSTGRES_URL} username: ${DB_NEXI_POSTGRES_USER} @@ -69,9 +69,9 @@ spring: ##permette di abilitare/disabilitare il datasource al db Postgres Nexi enabled: ${DB_NEXI_POSTGRES_ENABLED:'false'} connection-test-query: select 1 - connectionTimeout: ${DB_CONNECTION_TIMEOUT} - maxLifetime: ${DB_MAX_LIFETIME} - keepaliveTime: ${DB_KEEPALIVE_TIME} + connectionTimeout: ${DB_NEXI_POSTGRES_CONNECTION_TIMEOUT} + maxLifetime: ${DB_NEXI_POSTGRES_MAX_LIFETIME} + keepaliveTime: ${DB_NEXI_POSTGRES_KEEPALIVE_TIME} jpa: show-sql: 'false' From 3994722fa030679fd810a9dd28f335a97442cb0b Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Thu, 28 Mar 2024 15:17:11 +0000 Subject: [PATCH 07/32] Bump to version 0.0.1-8-fix-problems [skip ci] --- helm/Chart.yaml | 4 ++-- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- openapi/openapi.json | 2 +- pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 53692ec..10ecf72 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-afm-calculator description: Microservice that handles calculation for pagoPA Advanced Fees Management type: application -version: 0.42.0 -appVersion: 0.0.1-7-fix-problems +version: 0.43.0 +appVersion: 0.0.1-8-fix-problems dependencies: - name: microservice-chart version: 2.8.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 029785e..49d8b92 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-7-fix-problems" + tag: "0.0.1-8-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index b25501c..b113a56 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-7-fix-problems" + tag: "0.0.1-8-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 0697fa0..02c634f 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-7-fix-problems" + tag: "0.0.1-8-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi/openapi.json b/openapi/openapi.json index ca874d0..7a049fe 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "title": "cfg-sync", "description": "Microservice to update configuration schema of Nodo dei Pagamenti", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.0.1-7-fix-problems" + "version": "0.0.1-8-fix-problems" }, "servers": [ { diff --git a/pom.xml b/pom.xml index 08d89e5..d637719 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ it.gov.pagopa.node cfg-sync - 0.0.1-7-fix-problems + 0.0.1-8-fix-problems Microservice to update configuration schema of Nodo dei Pagamenti From 78fbca43313018873e210960426d72205caaca07 Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Thu, 28 Mar 2024 16:24:49 +0000 Subject: [PATCH 08/32] Bump to version 0.0.1-9-fix-problems [skip ci] --- helm/Chart.yaml | 4 ++-- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- openapi/openapi.json | 2 +- pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 10ecf72..aed6beb 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-afm-calculator description: Microservice that handles calculation for pagoPA Advanced Fees Management type: application -version: 0.43.0 -appVersion: 0.0.1-8-fix-problems +version: 0.44.0 +appVersion: 0.0.1-9-fix-problems dependencies: - name: microservice-chart version: 2.8.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 49d8b92..ef87140 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-8-fix-problems" + tag: "0.0.1-9-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index b113a56..eee8756 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-8-fix-problems" + tag: "0.0.1-9-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 02c634f..4d9d9bb 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-8-fix-problems" + tag: "0.0.1-9-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi/openapi.json b/openapi/openapi.json index 7a049fe..a030e41 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "title": "cfg-sync", "description": "Microservice to update configuration schema of Nodo dei Pagamenti", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.0.1-8-fix-problems" + "version": "0.0.1-9-fix-problems" }, "servers": [ { diff --git a/pom.xml b/pom.xml index d637719..ef8874f 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ it.gov.pagopa.node cfg-sync - 0.0.1-8-fix-problems + 0.0.1-9-fix-problems Microservice to update configuration schema of Nodo dei Pagamenti From 11380943daf95516001d76e9260f8df7406bb1df Mon Sep 17 00:00:00 2001 From: Francesco Parisi Date: Thu, 28 Mar 2024 17:27:39 +0100 Subject: [PATCH 09/32] fix log + Hikari params --- helm/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index aed6beb..a347f51 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -name: pagopa-afm-calculator +name: pagopa-node-sync-cfg description: Microservice that handles calculation for pagoPA Advanced Fees Management type: application version: 0.44.0 From 3d01d0bf65cdf7c6da8b0bfab969b4b5a0979788 Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Thu, 28 Mar 2024 16:30:27 +0000 Subject: [PATCH 10/32] Bump to version 0.0.1-10-fix-problems [skip ci] --- helm/Chart.yaml | 4 ++-- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- openapi/openapi.json | 2 +- pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index a347f51..ac2f037 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-node-sync-cfg description: Microservice that handles calculation for pagoPA Advanced Fees Management type: application -version: 0.44.0 -appVersion: 0.0.1-9-fix-problems +version: 0.45.0 +appVersion: 0.0.1-10-fix-problems dependencies: - name: microservice-chart version: 2.8.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index ef87140..921dff7 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-9-fix-problems" + tag: "0.0.1-10-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index eee8756..c247678 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-9-fix-problems" + tag: "0.0.1-10-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 4d9d9bb..4523761 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-9-fix-problems" + tag: "0.0.1-10-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi/openapi.json b/openapi/openapi.json index a030e41..3c47a68 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "title": "cfg-sync", "description": "Microservice to update configuration schema of Nodo dei Pagamenti", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.0.1-9-fix-problems" + "version": "0.0.1-10-fix-problems" }, "servers": [ { diff --git a/pom.xml b/pom.xml index ef8874f..748679d 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ it.gov.pagopa.node cfg-sync - 0.0.1-9-fix-problems + 0.0.1-10-fix-problems Microservice to update configuration schema of Nodo dei Pagamenti From 2d79a5c3b0cd1a5db8e83a9836b5bc53e94f82b1 Mon Sep 17 00:00:00 2001 From: Francesco Parisi Date: Thu, 28 Mar 2024 17:40:09 +0100 Subject: [PATCH 11/32] fix log + Hikari params --- helm/values-dev.yaml | 18 +++++++++--------- helm/values-prod.yaml | 18 +++++++++--------- helm/values-uat.yaml | 18 +++++++++--------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 921dff7..a6580b8 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -72,23 +72,23 @@ microservice-chart: DB_NEXI_POSTGRES_USER: "pp_nodo4_cfg" DB_NEXI_POSTGRES_ENABLED: "false" DB_NEXI_POSTGRES_SERVICE_IDENTIFIER: "NDP004DEV" - DB_NEXI_POSTGRES_CONNECTION_TIMEOUT: 15000 - DB_NEXI_POSTGRES_MAX_LIFETIME: 30000 - DB_NEXI_POSTGRES_KEEPALIVE_TIME: 30000 + DB_NEXI_POSTGRES_CONNECTION_TIMEOUT: "15000" + DB_NEXI_POSTGRES_MAX_LIFETIME: "30000" + DB_NEXI_POSTGRES_KEEPALIVE_TIME: "30000" DB_NEXI_ORACLE_URL: "jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS=(PROTOCOL=tcp)(PORT=1522)(HOST=db-nodo-pagamenti.d.db-nodo-pagamenti.com))(CONNECT_DATA=(SERVICE_NAME=NDPSPCT_PP_NODO4_CFG))(SO_KEEPALIVE=true)(TCP_KEEPIDLE=60)(TCP_KEEPINTVL=30)(TCP_KEEPCNT=15))" DB_NEXI_ORACLE_USER: "NODO4_CFG" DB_NEXI_ORACLE_ENABLED: "true" DB_NEXI_ORACLE_SERVICE_IDENTIFIER: "NDP003DEV" - DB_NEXI_ORACLE_CONNECTION_TIMEOUT: 15000 - DB_NEXI_ORACLE_MAX_LIFETIME: 30000 - DB_NEXI_ORACLE_KEEPALIVE_TIME: 30000 + DB_NEXI_ORACLE_CONNECTION_TIMEOUT: "15000" + DB_NEXI_ORACLE_MAX_LIFETIME: "30000" + DB_NEXI_ORACLE_KEEPALIVE_TIME: "30000" DB_PAGOPA_POSTGRES_URL: "jdbc:postgresql://ndp.d.db-nodo-pagamenti.com:6432/nodo?sslmode=require&prepareThreshold=0¤tSchema=cfg" DB_PAGOPA_POSTGRES_USER: "cfg" DB_PAGOPA_POSTGRES_ENABLED: "true" DB_PAGOPA_POSTGRES_SERVICE_IDENTIFIER: "NDP001DEV" - DB_PAGOPA_POSTGRES_CONNECTION_TIMEOUT: 15000 - DB_PAGOPA_POSTGRES_MAX_LIFETIME: 30000 - DB_PAGOPA_POSTGRES_KEEPALIVE_TIME: 30000 + DB_PAGOPA_POSTGRES_CONNECTION_TIMEOUT: "15000" + DB_PAGOPA_POSTGRES_MAX_LIFETIME: "30000" + DB_PAGOPA_POSTGRES_KEEPALIVE_TIME: "30000" API_CONFIG_CACHE_URL: "https://api.dev.platform.pagopa.it/api-config-cache/o/v1/stakeholders/node/cache/schemas/v1" STAND_IN_MANAGER_URL: "https://api.dev.platform.pagopa.it/stand-in-manager/api/v1" OTEL_SERVICE_NAME: "pagopanodecfgsync" diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index c247678..e875efd 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -72,23 +72,23 @@ microservice-chart: DB_NEXI_POSTGRES_USER: "pp_nodo4_cfg" DB_NEXI_POSTGRES_ENABLED: "false" DB_NEXI_POSTGRES_SERVICE_IDENTIFIER: "NDP004DEV" - DB_NEXI_POSTGRES_CONNECTION_TIMEOUT: 15000 - DB_NEXI_POSTGRES_MAX_LIFETIME: 30000 - DB_NEXI_POSTGRES_KEEPALIVE_TIME: 30000 + DB_NEXI_POSTGRES_CONNECTION_TIMEOUT: "15000" + DB_NEXI_POSTGRES_MAX_LIFETIME: "30000" + DB_NEXI_POSTGRES_KEEPALIVE_TIME: "30000" DB_CONFIG_URL: "jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS=(PROTOCOL=tcp)(PORT=1521)(HOST=db-nodo-pagamenti.p.db-nodo-pagamenti.com))(CONNECT_DATA=(SERVICE_NAME=NDPSPCP_NODO4_CFG))(SO_KEEPALIVE=true)(TCP_KEEPIDLE=60)(TCP_KEEPINTVL=30)(TCP_KEEPCNT=15))" DB_NEXI_ORACLE_USER: "NODO4_CFG" DB_NEXI_ORACLE_ENABLED: "true" DB_NEXI_ORACLE_SERVICE_IDENTIFIER: "NDP003DEV" - DB_NEXI_ORACLE_CONNECTION_TIMEOUT: 15000 - DB_NEXI_ORACLE_MAX_LIFETIME: 30000 - DB_NEXI_ORACLE_KEEPALIVE_TIME: 30000 + DB_NEXI_ORACLE_CONNECTION_TIMEOUT: "15000" + DB_NEXI_ORACLE_MAX_LIFETIME: "30000" + DB_NEXI_ORACLE_KEEPALIVE_TIME: "30000" DB_PAGOPA_POSTGRES_URL: "jdbc:postgresql://ndp.p.db-nodo-pagamenti.com:6432/nodo?sslmode=require&prepareThreshold=0¤tSchema=cfg" DB_PAGOPA_POSTGRES_USER: "cfg" DB_PAGOPA_POSTGRES_ENABLED: "true" DB_PAGOPA_POSTGRES_SERVICE_IDENTIFIER: "NDP001DEV" - DB_PAGOPA_POSTGRES_CONNECTION_TIMEOUT: 15000 - DB_PAGOPA_POSTGRES_MAX_LIFETIME: 30000 - DB_PAGOPA_POSTGRES_KEEPALIVE_TIME: 30000 + DB_PAGOPA_POSTGRES_CONNECTION_TIMEOUT: "15000" + DB_PAGOPA_POSTGRES_MAX_LIFETIME: "30000" + DB_PAGOPA_POSTGRES_KEEPALIVE_TIME: "30000" API_CONFIG_CACHE_URL: "https://api.uat.platform.pagopa.it/api-config-cache/o/v1/stakeholders/node/cache/schemas/v1" STAND_IN_MANAGER_URL: "https://api.uat.platform.pagopa.it/stand-in-manager/api/v1" OTEL_SERVICE_NAME: "pagopanodecfgsync" diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 4523761..6e5cbc4 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -72,23 +72,23 @@ microservice-chart: DB_NEXI_POSTGRES_USER: "pp_nodo4_cfg" DB_NEXI_POSTGRES_ENABLED: "false" DB_NEXI_POSTGRES_SERVICE_IDENTIFIER: "NDP004DEV" - DB_NEXI_POSTGRES_CONNECTION_TIMEOUT: 15000 - DB_NEXI_POSTGRES_MAX_LIFETIME: 30000 - DB_NEXI_POSTGRES_KEEPALIVE_TIME: 30000 + DB_NEXI_POSTGRES_CONNECTION_TIMEOUT: "15000" + DB_NEXI_POSTGRES_MAX_LIFETIME: "30000" + DB_NEXI_POSTGRES_KEEPALIVE_TIME: "30000" DB_CONFIG_URL: "jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS=(PROTOCOL=tcp)(PORT=1524)(HOST=db-nodo-pagamenti.u.db-nodo-pagamenti.com))(CONNECT_DATA=(SERVICE_NAME=NDPSPCA_NODO4_CFG))(SO_KEEPALIVE=true)(TCP_KEEPIDLE=60)(TCP_KEEPINTVL=30)(TCP_KEEPCNT=15))" DB_NEXI_ORACLE_USER: "NODO4_CFG" DB_NEXI_ORACLE_ENABLED: "true" DB_NEXI_ORACLE_SERVICE_IDENTIFIER: "NDP003DEV" - DB_NEXI_ORACLE_CONNECTION_TIMEOUT: 15000 - DB_NEXI_ORACLE_MAX_LIFETIME: 30000 - DB_NEXI_ORACLE_KEEPALIVE_TIME: 30000 + DB_NEXI_ORACLE_CONNECTION_TIMEOUT: "15000" + DB_NEXI_ORACLE_MAX_LIFETIME: "30000" + DB_NEXI_ORACLE_KEEPALIVE_TIME: "30000" DB_PAGOPA_POSTGRES_URL: "jdbc:postgresql://ndp.u.db-nodo-pagamenti.com:6432/nodo?sslmode=require&prepareThreshold=0¤tSchema=cfg" DB_PAGOPA_POSTGRES_USER: "cfg" DB_PAGOPA_POSTGRES_ENABLED: "true" DB_PAGOPA_POSTGRES_SERVICE_IDENTIFIER: "NDP001DEV" - DB_PAGOPA_POSTGRES_CONNECTION_TIMEOUT: 15000 - DB_PAGOPA_POSTGRES_MAX_LIFETIME: 30000 - DB_PAGOPA_POSTGRES_KEEPALIVE_TIME: 30000 + DB_PAGOPA_POSTGRES_CONNECTION_TIMEOUT: "15000" + DB_PAGOPA_POSTGRES_MAX_LIFETIME: "30000" + DB_PAGOPA_POSTGRES_KEEPALIVE_TIME: "30000" API_CONFIG_CACHE_URL: "https://api.uat.platform.pagopa.it/api-config-cache/o/v1/stakeholders/node/cache/schemas/v1" STAND_IN_MANAGER_URL: "https://api.uat.platform.pagopa.it/stand-in-manager/api/v1" OTEL_SERVICE_NAME: "pagopanodecfgsync" From 8d02edf396882b8d0e6a33d9a95a92b7cd188704 Mon Sep 17 00:00:00 2001 From: Francesco Parisi Date: Thu, 28 Mar 2024 17:40:26 +0100 Subject: [PATCH 12/32] fix log + Hikari params --- helm/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index ac2f037..dcbec47 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -name: pagopa-node-sync-cfg +name: pagopa-node-cfg-sync description: Microservice that handles calculation for pagoPA Advanced Fees Management type: application version: 0.45.0 From b253efe7412fc51bdbb5066c39b1fbbc2a3d740c Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Thu, 28 Mar 2024 16:42:31 +0000 Subject: [PATCH 13/32] Bump to version 0.0.1-11-fix-problems [skip ci] --- helm/Chart.yaml | 4 ++-- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- openapi/openapi.json | 2 +- pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index dcbec47..e64ae65 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-node-cfg-sync description: Microservice that handles calculation for pagoPA Advanced Fees Management type: application -version: 0.45.0 -appVersion: 0.0.1-10-fix-problems +version: 0.46.0 +appVersion: 0.0.1-11-fix-problems dependencies: - name: microservice-chart version: 2.8.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index a6580b8..7e4e1d7 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-10-fix-problems" + tag: "0.0.1-11-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index e875efd..c0e3e29 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-10-fix-problems" + tag: "0.0.1-11-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 6e5cbc4..3209749 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-10-fix-problems" + tag: "0.0.1-11-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi/openapi.json b/openapi/openapi.json index 3c47a68..ae679a5 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "title": "cfg-sync", "description": "Microservice to update configuration schema of Nodo dei Pagamenti", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.0.1-10-fix-problems" + "version": "0.0.1-11-fix-problems" }, "servers": [ { diff --git a/pom.xml b/pom.xml index 748679d..0327947 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ it.gov.pagopa.node cfg-sync - 0.0.1-10-fix-problems + 0.0.1-11-fix-problems Microservice to update configuration schema of Nodo dei Pagamenti From b8138aa8234bb1564b2d758877e6174b09643337 Mon Sep 17 00:00:00 2001 From: Francesco Parisi Date: Thu, 28 Mar 2024 18:02:17 +0100 Subject: [PATCH 14/32] fix Hikari params --- helm/Chart.yaml | 2 +- helm/values-dev.yaml | 3 --- helm/values-prod.yaml | 3 --- helm/values-uat.yaml | 3 --- src/main/resources/application-local.yaml | 13 +++++++++---- src/main/resources/application.yaml | 3 --- 6 files changed, 10 insertions(+), 17 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index e64ae65..79f664c 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: pagopa-node-cfg-sync -description: Microservice that handles calculation for pagoPA Advanced Fees Management +description: Microservice that sync api-config-cache and standin configuration type: application version: 0.46.0 appVersion: 0.0.1-11-fix-problems diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 7e4e1d7..8387dcf 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -74,21 +74,18 @@ microservice-chart: DB_NEXI_POSTGRES_SERVICE_IDENTIFIER: "NDP004DEV" DB_NEXI_POSTGRES_CONNECTION_TIMEOUT: "15000" DB_NEXI_POSTGRES_MAX_LIFETIME: "30000" - DB_NEXI_POSTGRES_KEEPALIVE_TIME: "30000" DB_NEXI_ORACLE_URL: "jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS=(PROTOCOL=tcp)(PORT=1522)(HOST=db-nodo-pagamenti.d.db-nodo-pagamenti.com))(CONNECT_DATA=(SERVICE_NAME=NDPSPCT_PP_NODO4_CFG))(SO_KEEPALIVE=true)(TCP_KEEPIDLE=60)(TCP_KEEPINTVL=30)(TCP_KEEPCNT=15))" DB_NEXI_ORACLE_USER: "NODO4_CFG" DB_NEXI_ORACLE_ENABLED: "true" DB_NEXI_ORACLE_SERVICE_IDENTIFIER: "NDP003DEV" DB_NEXI_ORACLE_CONNECTION_TIMEOUT: "15000" DB_NEXI_ORACLE_MAX_LIFETIME: "30000" - DB_NEXI_ORACLE_KEEPALIVE_TIME: "30000" DB_PAGOPA_POSTGRES_URL: "jdbc:postgresql://ndp.d.db-nodo-pagamenti.com:6432/nodo?sslmode=require&prepareThreshold=0¤tSchema=cfg" DB_PAGOPA_POSTGRES_USER: "cfg" DB_PAGOPA_POSTGRES_ENABLED: "true" DB_PAGOPA_POSTGRES_SERVICE_IDENTIFIER: "NDP001DEV" DB_PAGOPA_POSTGRES_CONNECTION_TIMEOUT: "15000" DB_PAGOPA_POSTGRES_MAX_LIFETIME: "30000" - DB_PAGOPA_POSTGRES_KEEPALIVE_TIME: "30000" API_CONFIG_CACHE_URL: "https://api.dev.platform.pagopa.it/api-config-cache/o/v1/stakeholders/node/cache/schemas/v1" STAND_IN_MANAGER_URL: "https://api.dev.platform.pagopa.it/stand-in-manager/api/v1" OTEL_SERVICE_NAME: "pagopanodecfgsync" diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index c0e3e29..ad577e5 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -74,21 +74,18 @@ microservice-chart: DB_NEXI_POSTGRES_SERVICE_IDENTIFIER: "NDP004DEV" DB_NEXI_POSTGRES_CONNECTION_TIMEOUT: "15000" DB_NEXI_POSTGRES_MAX_LIFETIME: "30000" - DB_NEXI_POSTGRES_KEEPALIVE_TIME: "30000" DB_CONFIG_URL: "jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS=(PROTOCOL=tcp)(PORT=1521)(HOST=db-nodo-pagamenti.p.db-nodo-pagamenti.com))(CONNECT_DATA=(SERVICE_NAME=NDPSPCP_NODO4_CFG))(SO_KEEPALIVE=true)(TCP_KEEPIDLE=60)(TCP_KEEPINTVL=30)(TCP_KEEPCNT=15))" DB_NEXI_ORACLE_USER: "NODO4_CFG" DB_NEXI_ORACLE_ENABLED: "true" DB_NEXI_ORACLE_SERVICE_IDENTIFIER: "NDP003DEV" DB_NEXI_ORACLE_CONNECTION_TIMEOUT: "15000" DB_NEXI_ORACLE_MAX_LIFETIME: "30000" - DB_NEXI_ORACLE_KEEPALIVE_TIME: "30000" DB_PAGOPA_POSTGRES_URL: "jdbc:postgresql://ndp.p.db-nodo-pagamenti.com:6432/nodo?sslmode=require&prepareThreshold=0¤tSchema=cfg" DB_PAGOPA_POSTGRES_USER: "cfg" DB_PAGOPA_POSTGRES_ENABLED: "true" DB_PAGOPA_POSTGRES_SERVICE_IDENTIFIER: "NDP001DEV" DB_PAGOPA_POSTGRES_CONNECTION_TIMEOUT: "15000" DB_PAGOPA_POSTGRES_MAX_LIFETIME: "30000" - DB_PAGOPA_POSTGRES_KEEPALIVE_TIME: "30000" API_CONFIG_CACHE_URL: "https://api.uat.platform.pagopa.it/api-config-cache/o/v1/stakeholders/node/cache/schemas/v1" STAND_IN_MANAGER_URL: "https://api.uat.platform.pagopa.it/stand-in-manager/api/v1" OTEL_SERVICE_NAME: "pagopanodecfgsync" diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 3209749..6463e0c 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -74,21 +74,18 @@ microservice-chart: DB_NEXI_POSTGRES_SERVICE_IDENTIFIER: "NDP004DEV" DB_NEXI_POSTGRES_CONNECTION_TIMEOUT: "15000" DB_NEXI_POSTGRES_MAX_LIFETIME: "30000" - DB_NEXI_POSTGRES_KEEPALIVE_TIME: "30000" DB_CONFIG_URL: "jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS=(PROTOCOL=tcp)(PORT=1524)(HOST=db-nodo-pagamenti.u.db-nodo-pagamenti.com))(CONNECT_DATA=(SERVICE_NAME=NDPSPCA_NODO4_CFG))(SO_KEEPALIVE=true)(TCP_KEEPIDLE=60)(TCP_KEEPINTVL=30)(TCP_KEEPCNT=15))" DB_NEXI_ORACLE_USER: "NODO4_CFG" DB_NEXI_ORACLE_ENABLED: "true" DB_NEXI_ORACLE_SERVICE_IDENTIFIER: "NDP003DEV" DB_NEXI_ORACLE_CONNECTION_TIMEOUT: "15000" DB_NEXI_ORACLE_MAX_LIFETIME: "30000" - DB_NEXI_ORACLE_KEEPALIVE_TIME: "30000" DB_PAGOPA_POSTGRES_URL: "jdbc:postgresql://ndp.u.db-nodo-pagamenti.com:6432/nodo?sslmode=require&prepareThreshold=0¤tSchema=cfg" DB_PAGOPA_POSTGRES_USER: "cfg" DB_PAGOPA_POSTGRES_ENABLED: "true" DB_PAGOPA_POSTGRES_SERVICE_IDENTIFIER: "NDP001DEV" DB_PAGOPA_POSTGRES_CONNECTION_TIMEOUT: "15000" DB_PAGOPA_POSTGRES_MAX_LIFETIME: "30000" - DB_PAGOPA_POSTGRES_KEEPALIVE_TIME: "30000" API_CONFIG_CACHE_URL: "https://api.uat.platform.pagopa.it/api-config-cache/o/v1/stakeholders/node/cache/schemas/v1" STAND_IN_MANAGER_URL: "https://api.uat.platform.pagopa.it/stand-in-manager/api/v1" OTEL_SERVICE_NAME: "pagopanodecfgsync" diff --git a/src/main/resources/application-local.yaml b/src/main/resources/application-local.yaml index c7dfe84..f2da753 100644 --- a/src/main/resources/application-local.yaml +++ b/src/main/resources/application-local.yaml @@ -13,10 +13,6 @@ app: spring: datasource: hikari: - connectionTimeout: 15000 - maxLifetime: 20000 - keepaliveTime: 30000 - connection-test-query: select 1 pagopa: postgres: url: jdbc:postgresql://pagopa-d-weu-nodo-flexible-postgresql.postgres.database.azure.com:6432/nodo?sslmode=require&prepareThreshold=0¤tSchema=cfg @@ -24,6 +20,9 @@ spring: password: ${DB_PAGOPA_POSTGRES_PASSWORD} ##permette di abilitare/disabilitare il datasource al db Postgres PagoPA enabled: ${DB_PAGOPA_POSTGRES_ENABLED:'false'} + connectionTimeout: 15000 + maxLifetime: 20000 + connection-test-query: select 1 nexi: oracle: url: jdbc:oracle:thin:@//localhost:1521/cfg @@ -31,12 +30,18 @@ spring: password: ${DB_NEXI_ORACLE_PASSWORD} ##permette di abilitare/disabilitare il datasource al db Oracle Nexi enabled: ${DB_NEXI_ORACLE_ENABLED:'false'} + connectionTimeout: 15000 + maxLifetime: 20000 + connection-test-query: select 1 from dual postgres: url: jdbc:postgresql://localhost:5432/nodo?currentSchema=public username: cfg password: ${DB_NEXI_POSTGRES_PASSWORD} ##permette di abilitare/disabilitare il datasource al db Postgres Nexi enabled: ${DB_NEXI_POSTGRES_ENABLED:'false'} + connectionTimeout: 15000 + maxLifetime: 20000 + connection-test-query: select 1 jpa: show-sql: 'false' diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 144d703..346be11 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -50,7 +50,6 @@ spring: connection-test-query: select 1 connectionTimeout: ${DB_PAGOPA_POSTGRES_CONNECTION_TIMEOUT} maxLifetime: ${DB_PAGOPA_POSTGRES_MAX_LIFETIME} - keepaliveTime: ${DB_PAGOPA_POSTGRES_KEEPALIVE_TIME} nexi: oracle: url: ${DB_NEXI_ORACLE_URL} @@ -61,7 +60,6 @@ spring: connection-test-query: select 1 from dual connectionTimeout: ${DB_NEXI_ORACLE_CONNECTION_TIMEOUT} maxLifetime: ${DB_NEXI_ORACLE_MAX_LIFETIME} - keepaliveTime: ${DB_NEXI_ORACLE_KEEPALIVE_TIME} postgres: url: ${DB_NEXI_POSTGRES_URL} username: ${DB_NEXI_POSTGRES_USER} @@ -71,7 +69,6 @@ spring: connection-test-query: select 1 connectionTimeout: ${DB_NEXI_POSTGRES_CONNECTION_TIMEOUT} maxLifetime: ${DB_NEXI_POSTGRES_MAX_LIFETIME} - keepaliveTime: ${DB_NEXI_POSTGRES_KEEPALIVE_TIME} jpa: show-sql: 'false' From 4baae292e087edc83b362023b6545f71d24b108d Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Thu, 28 Mar 2024 17:03:41 +0000 Subject: [PATCH 15/32] Bump to version 0.0.1-12-fix-problems [skip ci] --- helm/Chart.yaml | 4 ++-- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- openapi/openapi.json | 2 +- pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 79f664c..ebca4c5 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-node-cfg-sync description: Microservice that sync api-config-cache and standin configuration type: application -version: 0.46.0 -appVersion: 0.0.1-11-fix-problems +version: 0.47.0 +appVersion: 0.0.1-12-fix-problems dependencies: - name: microservice-chart version: 2.8.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 8387dcf..e5b8833 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-11-fix-problems" + tag: "0.0.1-12-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index ad577e5..b3ef8a8 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-11-fix-problems" + tag: "0.0.1-12-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 6463e0c..65ed7f1 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.1-11-fix-problems" + tag: "0.0.1-12-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi/openapi.json b/openapi/openapi.json index ae679a5..23e94ff 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "title": "cfg-sync", "description": "Microservice to update configuration schema of Nodo dei Pagamenti", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.0.1-11-fix-problems" + "version": "0.0.1-12-fix-problems" }, "servers": [ { diff --git a/pom.xml b/pom.xml index 0327947..ee8ebef 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ it.gov.pagopa.node cfg-sync - 0.0.1-11-fix-problems + 0.0.1-12-fix-problems Microservice to update configuration schema of Nodo dei Pagamenti From e86f53f51a6d3b7a3533aef76d843a52041c3d3b Mon Sep 17 00:00:00 2001 From: Francesco Parisi Date: Thu, 28 Mar 2024 18:53:26 +0100 Subject: [PATCH 16/32] add postman collection --- .../node-cfg-sync.postman_collection.json | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 postman-collection/node-cfg-sync.postman_collection.json diff --git a/postman-collection/node-cfg-sync.postman_collection.json b/postman-collection/node-cfg-sync.postman_collection.json new file mode 100644 index 0000000..f9f714e --- /dev/null +++ b/postman-collection/node-cfg-sync.postman_collection.json @@ -0,0 +1,71 @@ +{ + "info": { + "_postman_id": "47e7e8ae-e0ae-4585-b8b7-73dd7cef05ec", + "name": "node-cfg-sync", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "4579636", + "_collection_link": "https://speeding-station-482612.postman.co/workspace/Nodo-doc~ec880f84-0a42-4ca9-bbd1-454d00bbe20c/collection/4579636-47e7e8ae-e0ae-4585-b8b7-73dd7cef05ec?action=share&source=collection_link&creator=4579636" + }, + "item": [ + { + "name": "force cache", + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Ocp-Apim-Subscription-Key", + "value": "27edf137361f4a3392ddd055df0d2595", + "type": "text" + } + ], + "url": { + "raw": "{{URL_NODE_CFG_SYNC}}/v1/ndp/cache", + "host": [ + "{{URL_NODE_CFG_SYNC}}" + ], + "path": [ + "v1", + "ndp", + "cache" + ] + } + }, + "response": [] + }, + { + "name": "force stand-in", + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Ocp-Apim-Subscription-Key", + "value": "27edf137361f4a3392ddd055df0d2595", + "type": "text" + } + ], + "url": { + "raw": "{{URL_NODE_CFG_SYNC}}/v1/ndp/stand-in", + "host": [ + "{{URL_NODE_CFG_SYNC}}" + ], + "path": [ + "v1", + "ndp", + "stand-in" + ] + } + }, + "response": [] + } + ] +} \ No newline at end of file From 285d3843c7ea31d9554e6a7ad958d2f4dbf69fa6 Mon Sep 17 00:00:00 2001 From: Francesco Parisi Date: Fri, 29 Mar 2024 09:27:03 +0100 Subject: [PATCH 17/32] add postman collection --- openapi/openapi.json | 382 +++++++++--------- .../cfgsync/CacheSyncPostConstructorTest.java | 21 - .../cfgsync/StandInPostConstructorTest.java | 2 +- 3 files changed, 181 insertions(+), 224 deletions(-) delete mode 100644 src/test/java/it/gov/pagopa/node/cfgsync/CacheSyncPostConstructorTest.java diff --git a/openapi/openapi.json b/openapi/openapi.json index 23e94ff..284be29 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -1,286 +1,264 @@ { - "openapi": "3.0.1", - "info": { - "title": "cfg-sync", - "description": "Microservice to update configuration schema of Nodo dei Pagamenti", - "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.0.1-12-fix-problems" + "openapi" : "3.0.1", + "info" : { + "title" : "cfg-sync", + "description" : "@project.description@", + "termsOfService" : "https://www.pagopa.gov.it/", + "version" : "0.0.1-12-fix-problems" }, - "servers": [ - { - "url": "http://localhost", - "description": "Generated server url" - } - ], - "paths": { - "/ndp/cache": { - "put": { - "tags": [ - "Cache" - ], - "summary": "Force cache configuration to update", - "operationId": "cache", - "responses": { - "200": { - "description": "OK", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "servers" : [ { + "url" : "http://localhost", + "description" : "Generated server url" + } ], + "paths" : { + "/ndp/cache" : { + "put" : { + "tags" : [ "Cache" ], + "summary" : "Force cache configuration to update", + "operationId" : "cache", + "responses" : { + "200" : { + "description" : "OK", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SyncStatusResponse" + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SyncStatusResponse" } } } } }, - "400": { - "description": "Bad Request", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "400" : { + "description" : "Bad Request", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "401": { - "description": "Unauthorized", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Unauthorized", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "429": { - "description": "Too many requests", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "429" : { + "description" : "Too many requests", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "500": { - "description": "Service unavailable", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "500" : { + "description" : "Service unavailable", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema": { - "type": "string" - } + "parameters" : [ { + "name" : "X-Request-Id", + "in" : "header", + "description" : "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", + "schema" : { + "type" : "string" } - ] + } ] }, - "/ndp/stand-in": { - "put": { - "tags": [ - "StandIn" - ], - "summary": "Force stand-in configuration to update", - "operationId": "standin", - "responses": { - "200": { - "description": "OK", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "/ndp/stand-in" : { + "put" : { + "tags" : [ "StandIn" ], + "summary" : "Force stand-in configuration to update", + "operationId" : "standin", + "responses" : { + "200" : { + "description" : "OK", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SyncStatusResponse" + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SyncStatusResponse" } } } } }, - "400": { - "description": "Bad Request", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "400" : { + "description" : "Bad Request", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "401": { - "description": "Unauthorized", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Unauthorized", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "429": { - "description": "Too many requests", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "429" : { + "description" : "Too many requests", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "500": { - "description": "Service unavailable", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "500" : { + "description" : "Service unavailable", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema": { - "type": "string" - } + "parameters" : [ { + "name" : "X-Request-Id", + "in" : "header", + "description" : "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", + "schema" : { + "type" : "string" } - ] + } ] } }, - "components": { - "schemas": { - "ProblemJson": { - "type": "object", - "properties": { - "title": { - "type": "string", - "description": "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable" + "components" : { + "schemas" : { + "ProblemJson" : { + "type" : "object", + "properties" : { + "title" : { + "type" : "string", + "description" : "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable" }, - "status": { - "maximum": 600, - "minimum": 100, - "type": "integer", - "description": "The HTTP status code generated by the origin server for this occurrence of the problem.", - "format": "int32", - "example": 200 + "status" : { + "maximum" : 600, + "minimum" : 100, + "type" : "integer", + "description" : "The HTTP status code generated by the origin server for this occurrence of the problem.", + "format" : "int32", + "example" : 200 }, - "detail": { - "type": "string", - "description": "A human readable explanation specific to this occurrence of the problem.", - "example": "There was an error processing the request" + "detail" : { + "type" : "string", + "description" : "A human readable explanation specific to this occurrence of the problem.", + "example" : "There was an error processing the request" } } }, - "SyncStatusResponse": { - "required": [ - "serviceIdentifier", - "status" - ], - "type": "object", - "properties": { - "serviceIdentifier": { - "type": "string", - "description": "Database service identifier", - "example": "NDP001" + "SyncStatusResponse" : { + "required" : [ "serviceIdentifier", "status" ], + "type" : "object", + "properties" : { + "serviceIdentifier" : { + "type" : "string", + "description" : "Database service identifier", + "example" : "NDP001" }, - "status": { - "type": "string", - "description": "Database sync status result", - "example": "done", - "enum": [ - "DONE", - "DISABLED", - "ROLLBACK", - "ERROR" - ] + "status" : { + "type" : "string", + "description" : "Database sync status result", + "example" : "done", + "enum" : [ "DONE", "DISABLED", "ROLLBACK", "ERROR" ] } } } }, - "securitySchemes": { - "ApiKey": { - "type": "apiKey", - "description": "The API key to access this function app.", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" + "securitySchemes" : { + "ApiKey" : { + "type" : "apiKey", + "description" : "The API key to access this function app.", + "name" : "Ocp-Apim-Subscription-Key", + "in" : "header" } } } -} +} \ No newline at end of file diff --git a/src/test/java/it/gov/pagopa/node/cfgsync/CacheSyncPostConstructorTest.java b/src/test/java/it/gov/pagopa/node/cfgsync/CacheSyncPostConstructorTest.java deleted file mode 100644 index 2faa39f..0000000 --- a/src/test/java/it/gov/pagopa/node/cfgsync/CacheSyncPostConstructorTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package it.gov.pagopa.node.cfgsync; - -import it.gov.pagopa.node.cfgsync.service.ApiConfigCacheService; -import org.junit.jupiter.api.Test; -import org.junit.runner.RunWith; -import org.mockito.Mockito; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -@RunWith(SpringJUnit4ClassRunner.class) -class CacheSyncPostConstructorTest { - - @Test - void postConstruct() { -// final ApiConfigCacheService postConstructChild = Mockito.mock(ApiConfigCacheService.class); -// InOrder inOrder = Mockito.inOrder(postConstructChild); -// inOrder.verify(postConstructChild, Mockito.times(1)); - ApiConfigCacheService mockInstance = Mockito.mock(ApiConfigCacheService.class); - Mockito.verify(mockInstance, Mockito.times(1)).setApiConfigCacheClient(null); - } - -} diff --git a/src/test/java/it/gov/pagopa/node/cfgsync/StandInPostConstructorTest.java b/src/test/java/it/gov/pagopa/node/cfgsync/StandInPostConstructorTest.java index 562819a..d7ba163 100644 --- a/src/test/java/it/gov/pagopa/node/cfgsync/StandInPostConstructorTest.java +++ b/src/test/java/it/gov/pagopa/node/cfgsync/StandInPostConstructorTest.java @@ -12,7 +12,7 @@ class StandInPostConstructorTest { @Test void postConstruct() { - final StandInManagerService postConstructChild = Mockito.mock(StandInManagerService.class); + StandInManagerService postConstructChild = Mockito.mock(StandInManagerService.class); InOrder inOrder = Mockito.inOrder(postConstructChild); inOrder.verify(postConstructChild, Mockito.times(1)); } From eaff52b20c5e4d4f53f760f6195ac5f5faa726bc Mon Sep 17 00:00:00 2001 From: Francesco Parisi Date: Fri, 29 Mar 2024 09:32:08 +0100 Subject: [PATCH 18/32] add postman collection --- openapi/openapi.json | 38 +++++++++---------- .../cfgsync/StandInPostConstructorTest.java | 20 ---------- 2 files changed, 19 insertions(+), 39 deletions(-) delete mode 100644 src/test/java/it/gov/pagopa/node/cfgsync/StandInPostConstructorTest.java diff --git a/openapi/openapi.json b/openapi/openapi.json index 284be29..ab90e01 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -2,9 +2,9 @@ "openapi" : "3.0.1", "info" : { "title" : "cfg-sync", - "description" : "@project.description@", + "description" : "Microservice to update configuration schema of Nodo dei Pagamenti", "termsOfService" : "https://www.pagopa.gov.it/", - "version" : "0.0.1-12-fix-problems" + "version" : "0.0.2" }, "servers" : [ { "url" : "http://localhost", @@ -212,6 +212,23 @@ }, "components" : { "schemas" : { + "SyncStatusResponse" : { + "required" : [ "serviceIdentifier", "status" ], + "type" : "object", + "properties" : { + "serviceIdentifier" : { + "type" : "string", + "description" : "Database service identifier", + "example" : "NDP001" + }, + "status" : { + "type" : "string", + "description" : "Database sync status result", + "example" : "done", + "enum" : [ "DONE", "DISABLED", "ROLLBACK", "ERROR" ] + } + } + }, "ProblemJson" : { "type" : "object", "properties" : { @@ -233,23 +250,6 @@ "example" : "There was an error processing the request" } } - }, - "SyncStatusResponse" : { - "required" : [ "serviceIdentifier", "status" ], - "type" : "object", - "properties" : { - "serviceIdentifier" : { - "type" : "string", - "description" : "Database service identifier", - "example" : "NDP001" - }, - "status" : { - "type" : "string", - "description" : "Database sync status result", - "example" : "done", - "enum" : [ "DONE", "DISABLED", "ROLLBACK", "ERROR" ] - } - } } }, "securitySchemes" : { diff --git a/src/test/java/it/gov/pagopa/node/cfgsync/StandInPostConstructorTest.java b/src/test/java/it/gov/pagopa/node/cfgsync/StandInPostConstructorTest.java deleted file mode 100644 index d7ba163..0000000 --- a/src/test/java/it/gov/pagopa/node/cfgsync/StandInPostConstructorTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package it.gov.pagopa.node.cfgsync; - -import it.gov.pagopa.node.cfgsync.service.StandInManagerService; -import org.junit.jupiter.api.Test; -import org.junit.runner.RunWith; -import org.mockito.InOrder; -import org.mockito.Mockito; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -@RunWith(SpringJUnit4ClassRunner.class) -class StandInPostConstructorTest { - - @Test - void postConstruct() { - StandInManagerService postConstructChild = Mockito.mock(StandInManagerService.class); - InOrder inOrder = Mockito.inOrder(postConstructChild); - inOrder.verify(postConstructChild, Mockito.times(1)); - } - -} From 34b0c5b283839f63f0373e962fbd90aadc95eec7 Mon Sep 17 00:00:00 2001 From: Francesco Cesareo Date: Fri, 29 Mar 2024 09:40:25 +0100 Subject: [PATCH 19/32] fix dockerfile --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0a2d781..e9e9154 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN java -Djarmode=layertools -jar application.jar extract FROM ghcr.io/pagopa/docker-base-springboot-openjdk17:v1.1.0@sha256:6fa320d452fa22066441f1ef292d15eb06f944bc8bca293e1a91ea460d30a613 WORKDIR /app -ADD --chown=spring:spring https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.25.1/opentelemetry-javaagent.jar . +#ADD --chown=spring:spring https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.25.1/opentelemetry-javaagent.jar . COPY --chown=spring:spring --from=builder /app/dependencies/ ./ COPY --chown=spring:spring --from=builder /app/snapshot-dependencies/ ./ @@ -25,4 +25,5 @@ COPY --chown=spring:spring --from=builder /app/application/ ./ EXPOSE 8080 -ENTRYPOINT ["java","-javaagent:opentelemetry-javaagent.jar","--enable-preview","org.springframework.boot.loader.JarLauncher"] +#ENTRYPOINT ["java","-javaagent:opentelemetry-javaagent.jar","--enable-preview","org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["java", "--enable-preview","org.springframework.boot.loader.JarLauncher"] From d2ec786c61deb6aea496210cd260fcff57f841c1 Mon Sep 17 00:00:00 2001 From: Francesco Cesareo Date: Fri, 29 Mar 2024 09:53:56 +0100 Subject: [PATCH 20/32] fix identity --- .identity/02_application_action.tf | 192 ++++++++++++++--------------- 1 file changed, 96 insertions(+), 96 deletions(-) diff --git a/.identity/02_application_action.tf b/.identity/02_application_action.tf index d6a7a24..cf38593 100644 --- a/.identity/02_application_action.tf +++ b/.identity/02_application_action.tf @@ -1,96 +1,96 @@ -module "github_runner_app" { - source = "git::https://github.com/pagopa/github-actions-tf-modules.git//app-github-runner-creator?ref=main" - - app_name = local.app_name - - subscription_id = data.azurerm_subscription.current.id - - github_org = local.github.org - github_repository = local.github.repository - github_environment_name = var.env - - container_app_github_runner_env_rg = local.container_app_environment.resource_group -} - -resource "null_resource" "github_runner_app_permissions_to_namespace" { - triggers = { - aks_id = data.azurerm_kubernetes_cluster.aks.id - service_principal_id = module.github_runner_app.client_id - namespace = local.domain - version = "v2" - } - - provisioner "local-exec" { - command = < Date: Fri, 29 Mar 2024 09:02:47 +0000 Subject: [PATCH 21/32] Bump to version 0.0.2-1-fix-problems [skip ci] --- helm/Chart.yaml | 4 +- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- openapi/openapi.json | 382 ++++++++++++++++++++++-------------------- pom.xml | 2 +- 6 files changed, 208 insertions(+), 186 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 4c002f8..346529b 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-node-cfg-sync description: Microservice that sync api-config-cache and standin configuration type: application -version: 0.47.0 -appVersion: 0.0.2 +version: 0.48.0 +appVersion: 0.0.2-1-fix-problems dependencies: - name: microservice-chart version: 2.8.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 644179e..e0d83b9 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.2" + tag: "0.0.2-1-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 9c874fc..25671cd 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.2" + tag: "0.0.2-1-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index e4845ea..40a8ef2 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.2" + tag: "0.0.2-1-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi/openapi.json b/openapi/openapi.json index ab90e01..090c471 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -1,264 +1,286 @@ { - "openapi" : "3.0.1", - "info" : { - "title" : "cfg-sync", - "description" : "Microservice to update configuration schema of Nodo dei Pagamenti", - "termsOfService" : "https://www.pagopa.gov.it/", - "version" : "0.0.2" + "openapi": "3.0.1", + "info": { + "title": "cfg-sync", + "description": "Microservice to update configuration schema of Nodo dei Pagamenti", + "termsOfService": "https://www.pagopa.gov.it/", + "version": "0.0.2-1-fix-problems" }, - "servers" : [ { - "url" : "http://localhost", - "description" : "Generated server url" - } ], - "paths" : { - "/ndp/cache" : { - "put" : { - "tags" : [ "Cache" ], - "summary" : "Force cache configuration to update", - "operationId" : "cache", - "responses" : { - "200" : { - "description" : "OK", - "headers" : { - "X-Request-Id" : { - "description" : "This header identifies the call", - "schema" : { - "type" : "string" + "servers": [ + { + "url": "http://localhost", + "description": "Generated server url" + } + ], + "paths": { + "/ndp/cache": { + "put": { + "tags": [ + "Cache" + ], + "summary": "Force cache configuration to update", + "operationId": "cache", + "responses": { + "200": { + "description": "OK", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" } } }, - "content" : { - "application/json" : { - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SyncStatusResponse" + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SyncStatusResponse" } } } } }, - "400" : { - "description" : "Bad Request", - "headers" : { - "X-Request-Id" : { - "description" : "This header identifies the call", - "schema" : { - "type" : "string" + "400": { + "description": "Bad Request", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" } } }, - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ProblemJson" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" } } } }, - "401" : { - "description" : "Unauthorized", - "headers" : { - "X-Request-Id" : { - "description" : "This header identifies the call", - "schema" : { - "type" : "string" + "401": { + "description": "Unauthorized", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" } } } }, - "429" : { - "description" : "Too many requests", - "headers" : { - "X-Request-Id" : { - "description" : "This header identifies the call", - "schema" : { - "type" : "string" + "429": { + "description": "Too many requests", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" } } } }, - "500" : { - "description" : "Service unavailable", - "headers" : { - "X-Request-Id" : { - "description" : "This header identifies the call", - "schema" : { - "type" : "string" + "500": { + "description": "Service unavailable", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" } } }, - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ProblemJson" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" } } } } }, - "security" : [ { - "ApiKey" : [ ] - } ] + "security": [ + { + "ApiKey": [] + } + ] }, - "parameters" : [ { - "name" : "X-Request-Id", - "in" : "header", - "description" : "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema" : { - "type" : "string" + "parameters": [ + { + "name": "X-Request-Id", + "in": "header", + "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", + "schema": { + "type": "string" + } } - } ] + ] }, - "/ndp/stand-in" : { - "put" : { - "tags" : [ "StandIn" ], - "summary" : "Force stand-in configuration to update", - "operationId" : "standin", - "responses" : { - "200" : { - "description" : "OK", - "headers" : { - "X-Request-Id" : { - "description" : "This header identifies the call", - "schema" : { - "type" : "string" + "/ndp/stand-in": { + "put": { + "tags": [ + "StandIn" + ], + "summary": "Force stand-in configuration to update", + "operationId": "standin", + "responses": { + "200": { + "description": "OK", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" } } }, - "content" : { - "application/json" : { - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/SyncStatusResponse" + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SyncStatusResponse" } } } } }, - "400" : { - "description" : "Bad Request", - "headers" : { - "X-Request-Id" : { - "description" : "This header identifies the call", - "schema" : { - "type" : "string" + "400": { + "description": "Bad Request", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" } } }, - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ProblemJson" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" } } } }, - "401" : { - "description" : "Unauthorized", - "headers" : { - "X-Request-Id" : { - "description" : "This header identifies the call", - "schema" : { - "type" : "string" + "401": { + "description": "Unauthorized", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" } } } }, - "429" : { - "description" : "Too many requests", - "headers" : { - "X-Request-Id" : { - "description" : "This header identifies the call", - "schema" : { - "type" : "string" + "429": { + "description": "Too many requests", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" } } } }, - "500" : { - "description" : "Service unavailable", - "headers" : { - "X-Request-Id" : { - "description" : "This header identifies the call", - "schema" : { - "type" : "string" + "500": { + "description": "Service unavailable", + "headers": { + "X-Request-Id": { + "description": "This header identifies the call", + "schema": { + "type": "string" } } }, - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ProblemJson" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" } } } } }, - "security" : [ { - "ApiKey" : [ ] - } ] + "security": [ + { + "ApiKey": [] + } + ] }, - "parameters" : [ { - "name" : "X-Request-Id", - "in" : "header", - "description" : "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema" : { - "type" : "string" + "parameters": [ + { + "name": "X-Request-Id", + "in": "header", + "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", + "schema": { + "type": "string" + } } - } ] + ] } }, - "components" : { - "schemas" : { - "SyncStatusResponse" : { - "required" : [ "serviceIdentifier", "status" ], - "type" : "object", - "properties" : { - "serviceIdentifier" : { - "type" : "string", - "description" : "Database service identifier", - "example" : "NDP001" + "components": { + "schemas": { + "SyncStatusResponse": { + "required": [ + "serviceIdentifier", + "status" + ], + "type": "object", + "properties": { + "serviceIdentifier": { + "type": "string", + "description": "Database service identifier", + "example": "NDP001" }, - "status" : { - "type" : "string", - "description" : "Database sync status result", - "example" : "done", - "enum" : [ "DONE", "DISABLED", "ROLLBACK", "ERROR" ] + "status": { + "type": "string", + "description": "Database sync status result", + "example": "done", + "enum": [ + "DONE", + "DISABLED", + "ROLLBACK", + "ERROR" + ] } } }, - "ProblemJson" : { - "type" : "object", - "properties" : { - "title" : { - "type" : "string", - "description" : "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable" + "ProblemJson": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable" }, - "status" : { - "maximum" : 600, - "minimum" : 100, - "type" : "integer", - "description" : "The HTTP status code generated by the origin server for this occurrence of the problem.", - "format" : "int32", - "example" : 200 + "status": { + "maximum": 600, + "minimum": 100, + "type": "integer", + "description": "The HTTP status code generated by the origin server for this occurrence of the problem.", + "format": "int32", + "example": 200 }, - "detail" : { - "type" : "string", - "description" : "A human readable explanation specific to this occurrence of the problem.", - "example" : "There was an error processing the request" + "detail": { + "type": "string", + "description": "A human readable explanation specific to this occurrence of the problem.", + "example": "There was an error processing the request" } } } }, - "securitySchemes" : { - "ApiKey" : { - "type" : "apiKey", - "description" : "The API key to access this function app.", - "name" : "Ocp-Apim-Subscription-Key", - "in" : "header" + "securitySchemes": { + "ApiKey": { + "type": "apiKey", + "description": "The API key to access this function app.", + "name": "Ocp-Apim-Subscription-Key", + "in": "header" } } } -} \ No newline at end of file +} diff --git a/pom.xml b/pom.xml index b2dcef0..afa7859 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ it.gov.pagopa.node cfg-sync - 0.0.2 + 0.0.2-1-fix-problems Microservice to update configuration schema of Nodo dei Pagamenti From f8037f3699ca341c58a1a891dc386e04b6b3ad7c Mon Sep 17 00:00:00 2001 From: diegoitaliait Date: Fri, 29 Mar 2024 11:48:23 +0100 Subject: [PATCH 22/32] updated terraform locks --- .identity/.terraform.lock.hcl | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/.identity/.terraform.lock.hcl b/.identity/.terraform.lock.hcl index 6c149f8..086c095 100644 --- a/.identity/.terraform.lock.hcl +++ b/.identity/.terraform.lock.hcl @@ -5,7 +5,10 @@ provider "registry.terraform.io/hashicorp/azuread" { version = "2.30.0" constraints = "2.30.0" hashes = [ + "h1:MimDtBEnmdMwbriZQzga/kCjDZ1G0+QLVQjrYdBEpdc=", "h1:WnSPiREAFwnBUKREokMdHQ8Cjs47MzvS9pG8VS1ktec=", + "h1:eMxghqjmi2DCdps3dgo2SVOUfebzCatA3OdsTowlqXw=", + "h1:xzNKb+lWPsBTxJiaAJ8ECZnY+D6QNM9tA1qpEncIba0=", "zh:1c3e89cf19118fc07d7b04257251fc9897e722c16e0a0df7b07fcd261f8c12e7", "zh:2e62c193030e04ebb10cc0526119cf69824bf2d7e4ea5a2f45bd5d5fb7221d36", "zh:2f3c7a35257332d68b778cefc5201a5f044e4914dd03794a4da662ddfe756483", @@ -25,6 +28,9 @@ provider "registry.terraform.io/hashicorp/azurerm" { version = "3.45.0" constraints = "3.45.0" hashes = [ + "h1:4BOYXFMiLk4ozEZHUhquRnE5urebcWvaCUV3uys646o=", + "h1:V3CLlXij3vZzxw51hvCBnqriy73llPG21NjO+7sLr+U=", + "h1:WupjURkT1JPNBRzKmrSsD1Y8zhuQnL3ctKBpNLZBsLA=", "h1:gQLNY1I5e9kcle1p/VYEWb0eteQ/t5kUfnqVu2/GBNY=", "zh:04c5dbb8845366ce5eb0dc2d55e151270cc2c0ace20993867fdae9af43b953ad", "zh:2589585da615ccae341400d45d672ee3fae413fdd88449b5befeff12a85a44b2", @@ -41,29 +47,13 @@ provider "registry.terraform.io/hashicorp/azurerm" { ] } -provider "registry.terraform.io/hashicorp/null" { - version = "3.2.2" - hashes = [ - "h1:vWAsYRd7MjYr3adj8BVKRohVfHpWQdvkIwUQ2Jf5FVM=", - "zh:3248aae6a2198f3ec8394218d05bd5e42be59f43a3a7c0b71c66ec0df08b69e7", - "zh:32b1aaa1c3013d33c245493f4a65465eab9436b454d250102729321a44c8ab9a", - "zh:38eff7e470acb48f66380a73a5c7cdd76cc9b9c9ba9a7249c7991488abe22fe3", - "zh:4c2f1faee67af104f5f9e711c4574ff4d298afaa8a420680b0cb55d7bbc65606", - "zh:544b33b757c0b954dbb87db83a5ad921edd61f02f1dc86c6186a5ea86465b546", - "zh:696cf785090e1e8cf1587499516b0494f47413b43cb99877ad97f5d0de3dc539", - "zh:6e301f34757b5d265ae44467d95306d61bef5e41930be1365f5a8dcf80f59452", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:913a929070c819e59e94bb37a2a253c228f83921136ff4a7aa1a178c7cce5422", - "zh:aa9015926cd152425dbf86d1abdbc74bfe0e1ba3d26b3db35051d7b9ca9f72ae", - "zh:bb04798b016e1e1d49bcc76d62c53b56c88c63d6f2dfe38821afef17c416a0e1", - "zh:c23084e1b23577de22603cff752e59128d83cfecc2e6819edadd8cf7a10af11e", - ] -} - provider "registry.terraform.io/integrations/github" { version = "5.18.3" constraints = "5.18.3" hashes = [ + "h1:+WUsuR5XPYdbKwQi13GxEVKRV+JgkRa3Bw/HaCG/oeM=", + "h1:EKpGchrcouicFulbwG00s3NmXWsDDnlhffWqnGANSQQ=", + "h1:Z/0vjFX80YzM3Oeq0mBbn4XYwb1POggjsu3RVQcbjNc=", "h1:rv3mwpUeJ0n13sY+KZMI25WAVCSeipX4n8JMWKD1XcE=", "zh:050b37d96628cb7451137755929ca8d21ea546bc46d11a715652584070e83ff2", "zh:053051061f1b7f7673b0ceffac1f239ba28b0e5b375999206fd39976e85d9f2b", From f0100e7228384642f9a59f9eb7b9d178af6620f7 Mon Sep 17 00:00:00 2001 From: Francesco Parisi Date: Fri, 29 Mar 2024 15:00:38 +0100 Subject: [PATCH 23/32] change alert logs --- .../node/cfgsync/service/ApiConfigCacheEhConsumer.java | 3 +-- .../pagopa/node/cfgsync/service/ApiConfigCacheService.java | 2 +- .../gov/pagopa/node/cfgsync/service/CommonCacheService.java | 5 ++++- .../node/cfgsync/service/StandInManagerEhConsumer.java | 5 +---- .../pagopa/node/cfgsync/service/StandInManagerService.java | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/java/it/gov/pagopa/node/cfgsync/service/ApiConfigCacheEhConsumer.java b/src/main/java/it/gov/pagopa/node/cfgsync/service/ApiConfigCacheEhConsumer.java index 5f169e7..8e20ebd 100644 --- a/src/main/java/it/gov/pagopa/node/cfgsync/service/ApiConfigCacheEhConsumer.java +++ b/src/main/java/it/gov/pagopa/node/cfgsync/service/ApiConfigCacheEhConsumer.java @@ -54,8 +54,7 @@ public void processEvent(EventContext eventContext) { TargetRefreshEnum.cache.label, eventContext.getPartitionContext().getPartitionId(), eventContext.getEventData().getSequenceNumber(), eventContext.getEventData().getBodyAsString()); - Map syncStatusEnumMap = apiConfigCacheService.syncCache(); - log.info("[{}][ALERT] Processed event: {}", TargetRefreshEnum.cache.label, syncStatusEnumMap.toString()); + apiConfigCacheService.syncCache(); } public void processError(ErrorContext errorContext) { diff --git a/src/main/java/it/gov/pagopa/node/cfgsync/service/ApiConfigCacheService.java b/src/main/java/it/gov/pagopa/node/cfgsync/service/ApiConfigCacheService.java index bca725b..bb9578b 100644 --- a/src/main/java/it/gov/pagopa/node/cfgsync/service/ApiConfigCacheService.java +++ b/src/main/java/it/gov/pagopa/node/cfgsync/service/ApiConfigCacheService.java @@ -100,7 +100,7 @@ public Map syncCache() { saveNexiPostgres(syncStatusMap, configCache); saveNexiOracle(syncStatusMap, configCache); - return composeSyncStatusMapResult(syncStatusMap); + return composeSyncStatusMapResult(TargetRefreshEnum.cache.label, syncStatusMap); } catch (FeignException fEx) { log.error("[{}] error: {}", TargetRefreshEnum.cache.label, fEx.getMessage(), fEx); throw new AppException(AppError.INTERNAL_SERVER_ERROR); diff --git a/src/main/java/it/gov/pagopa/node/cfgsync/service/CommonCacheService.java b/src/main/java/it/gov/pagopa/node/cfgsync/service/CommonCacheService.java index 6d3d10c..cd727df 100644 --- a/src/main/java/it/gov/pagopa/node/cfgsync/service/CommonCacheService.java +++ b/src/main/java/it/gov/pagopa/node/cfgsync/service/CommonCacheService.java @@ -4,6 +4,7 @@ import it.gov.pagopa.node.cfgsync.exception.AppException; import it.gov.pagopa.node.cfgsync.exception.SyncDbStatusException; import it.gov.pagopa.node.cfgsync.model.SyncStatusEnum; +import it.gov.pagopa.node.cfgsync.model.TargetRefreshEnum; import it.gov.pagopa.node.cfgsync.repository.model.ConfigCache; import it.gov.pagopa.node.cfgsync.util.Utils; import lombok.Getter; @@ -48,7 +49,7 @@ protected Object getHeaderParameter(String target, Map composeSyncStatusMapResult(Map syncStatusMap) { + protected Map composeSyncStatusMapResult(String event, Map syncStatusMap) { Map syncStatusMapUpdated = new LinkedHashMap<>(); if( syncStatusMap.containsValue(SyncStatusEnum.ERROR) ) { syncStatusMap.forEach((k, v) -> { @@ -58,8 +59,10 @@ protected Map composeSyncStatusMapResult(Map syncStatusEnumMap = standInManagerService.syncStandIn(); - log.info("[{}][ALERT] Processed event: {}", TargetRefreshEnum.standin.label, syncStatusEnumMap.toString()); + standInManagerService.syncStandIn(); } public void processError(ErrorContext errorContext) { diff --git a/src/main/java/it/gov/pagopa/node/cfgsync/service/StandInManagerService.java b/src/main/java/it/gov/pagopa/node/cfgsync/service/StandInManagerService.java index 09de606..5583b8c 100644 --- a/src/main/java/it/gov/pagopa/node/cfgsync/service/StandInManagerService.java +++ b/src/main/java/it/gov/pagopa/node/cfgsync/service/StandInManagerService.java @@ -93,7 +93,7 @@ public Map syncStandIn() { saveNexiPostgres(syncStatusMap, stationsEntities); saveNexiOracle(syncStatusMap, stationsEntities); - return composeSyncStatusMapResult(syncStatusMap); + return composeSyncStatusMapResult(TargetRefreshEnum.standin.label, syncStatusMap); } catch (FeignException fEx) { log.error("[{}] error: {}", TargetRefreshEnum.standin.label, fEx.getMessage(), fEx); throw new AppException(AppError.INTERNAL_SERVER_ERROR); From bed00bf56906dbabbb7ff9284f13a2846c361a15 Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Fri, 29 Mar 2024 14:04:14 +0000 Subject: [PATCH 24/32] Bump to version 0.0.2-2-fix-problems [skip ci] --- helm/Chart.yaml | 4 ++-- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- openapi/openapi.json | 2 +- pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 346529b..3916fe3 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-node-cfg-sync description: Microservice that sync api-config-cache and standin configuration type: application -version: 0.48.0 -appVersion: 0.0.2-1-fix-problems +version: 0.49.0 +appVersion: 0.0.2-2-fix-problems dependencies: - name: microservice-chart version: 2.8.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index e0d83b9..0f3bac1 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.2-1-fix-problems" + tag: "0.0.2-2-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 25671cd..b4b259d 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.2-1-fix-problems" + tag: "0.0.2-2-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 40a8ef2..d675581 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.2-1-fix-problems" + tag: "0.0.2-2-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi/openapi.json b/openapi/openapi.json index 090c471..5540391 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "title": "cfg-sync", "description": "Microservice to update configuration schema of Nodo dei Pagamenti", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.0.2-1-fix-problems" + "version": "0.0.2-2-fix-problems" }, "servers": [ { diff --git a/pom.xml b/pom.xml index afa7859..2ac7f87 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ it.gov.pagopa.node cfg-sync - 0.0.2-1-fix-problems + 0.0.2-2-fix-problems Microservice to update configuration schema of Nodo dei Pagamenti From 1e8e953c09d90b27e0cd37ffb1d2704dc51d0e71 Mon Sep 17 00:00:00 2001 From: Francesco Cesareo Date: Tue, 2 Apr 2024 11:37:44 +0200 Subject: [PATCH 25/32] fix dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e9e9154..36ff400 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ COPY --from=buildtime /build/target/*.jar /app/application.jar RUN java -Djarmode=layertools -jar application.jar extract -FROM ghcr.io/pagopa/docker-base-springboot-openjdk17:v1.1.0@sha256:6fa320d452fa22066441f1ef292d15eb06f944bc8bca293e1a91ea460d30a613 +FROM ghcr.io/pagopa/docker-base-springboot-openjdk17:v1.1.3@sha256:a6704e1071407d8eaf0fc42189df30b112d299c0c7f69c5bd26cc5a77d1491b5 WORKDIR /app #ADD --chown=spring:spring https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.25.1/opentelemetry-javaagent.jar . From 9ff781a2e2cff16a7e8314071e3f370a893409ae Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Tue, 2 Apr 2024 09:40:07 +0000 Subject: [PATCH 26/32] Bump to version 0.0.2-3-fix-problems [skip ci] --- helm/Chart.yaml | 4 ++-- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- openapi/openapi.json | 2 +- pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 3916fe3..1446bad 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-node-cfg-sync description: Microservice that sync api-config-cache and standin configuration type: application -version: 0.49.0 -appVersion: 0.0.2-2-fix-problems +version: 0.50.0 +appVersion: 0.0.2-3-fix-problems dependencies: - name: microservice-chart version: 2.8.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 0f3bac1..8757692 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.2-2-fix-problems" + tag: "0.0.2-3-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index b4b259d..7236d69 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.2-2-fix-problems" + tag: "0.0.2-3-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index d675581..fdb1f4b 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.2-2-fix-problems" + tag: "0.0.2-3-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi/openapi.json b/openapi/openapi.json index 5540391..fd67807 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "title": "cfg-sync", "description": "Microservice to update configuration schema of Nodo dei Pagamenti", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.0.2-2-fix-problems" + "version": "0.0.2-3-fix-problems" }, "servers": [ { diff --git a/pom.xml b/pom.xml index 2ac7f87..7248796 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ it.gov.pagopa.node cfg-sync - 0.0.2-2-fix-problems + 0.0.2-3-fix-problems Microservice to update configuration schema of Nodo dei Pagamenti From b20268e7303bdd81a5244447f428c1215cd93316 Mon Sep 17 00:00:00 2001 From: Francesco Cesareo Date: Tue, 2 Apr 2024 12:24:53 +0200 Subject: [PATCH 27/32] fix sha256 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 36ff400..de00fe2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ COPY --from=buildtime /build/target/*.jar /app/application.jar RUN java -Djarmode=layertools -jar application.jar extract -FROM ghcr.io/pagopa/docker-base-springboot-openjdk17:v1.1.3@sha256:a6704e1071407d8eaf0fc42189df30b112d299c0c7f69c5bd26cc5a77d1491b5 +FROM ghcr.io/pagopa/docker-base-springboot-openjdk17:v1.1.3@sha256:5e2ac4136b7a31a0d1eae8d902aa006bd8c6f5a4ae5a1d289cabd369b8d06c80 WORKDIR /app #ADD --chown=spring:spring https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.25.1/opentelemetry-javaagent.jar . From f7e0cdef98b46ca0972766d2d04b6897c179fef5 Mon Sep 17 00:00:00 2001 From: Francesco Cesareo Date: Tue, 2 Apr 2024 12:26:27 +0200 Subject: [PATCH 28/32] fix sha256 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index de00fe2..ed70034 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ COPY --from=buildtime /build/target/*.jar /app/application.jar RUN java -Djarmode=layertools -jar application.jar extract -FROM ghcr.io/pagopa/docker-base-springboot-openjdk17:v1.1.3@sha256:5e2ac4136b7a31a0d1eae8d902aa006bd8c6f5a4ae5a1d289cabd369b8d06c80 +FROM ghcr.io/pagopa/docker-base-springboot-openjdk17:v1.1.3@sha256:4553fcc6d450cfa21b4c1a1ee68d10c90857a6bd37885c9ea53a3ef5cc289288 WORKDIR /app #ADD --chown=spring:spring https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.25.1/opentelemetry-javaagent.jar . From c0971523f93389eef7f5cc8078b8c2a5ec703a93 Mon Sep 17 00:00:00 2001 From: Francesco Cesareo Date: Tue, 2 Apr 2024 12:35:10 +0200 Subject: [PATCH 29/32] fix sha256 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ed70034..ca0ff1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ COPY --from=buildtime /build/target/*.jar /app/application.jar RUN java -Djarmode=layertools -jar application.jar extract -FROM ghcr.io/pagopa/docker-base-springboot-openjdk17:v1.1.3@sha256:4553fcc6d450cfa21b4c1a1ee68d10c90857a6bd37885c9ea53a3ef5cc289288 +FROM ghcr.io/pagopa/docker-base-springboot-openjdk17:v1.1.3@sha256:a4e970ef05ecf2081424a64707e7c20856bbc40ddb3e99b32a24cd74591817c4 WORKDIR /app #ADD --chown=spring:spring https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.25.1/opentelemetry-javaagent.jar . From 804c3b0f2b0c2a94110f8b1bd8a1510262d95d08 Mon Sep 17 00:00:00 2001 From: Francesco Cesareo Date: Tue, 2 Apr 2024 12:37:18 +0200 Subject: [PATCH 30/32] fix dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ca0ff1f..7f048f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ # # Build # -FROM maven:3.9.5-amazoncorretto-17-al2023@sha256:eeaa7ab572d931f7273fc5cf31429923f172091ae388969e11f42ec6dd817d74 as buildtime +FROM maven:3.9.6-amazoncorretto-17-al2023@sha256:4c8bd9ec72b372f587f7b9d92564a307e4f5180b7ec08455fb346617bae1757e as buildtime WORKDIR /build COPY . . RUN mvn clean package -DskipTests -FROM amazoncorretto:17.0.9-alpine3.18@sha256:df48bf2e183230040890460ddb4359a10aa6c7aad24bd88899482c52053c7e17 as builder +FROM amazoncorretto:17.0.10-alpine3.19@sha256:180e9c91bdbaad3599fedd2f492bf0d0335a9382835aa64669b2c2a8de7c9a22 as builder WORKDIR /app COPY --from=buildtime /build/target/*.jar /app/application.jar RUN java -Djarmode=layertools -jar application.jar extract From ca6ae513faf30a7fb2396f254114021f616e11ae Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Tue, 2 Apr 2024 10:43:15 +0000 Subject: [PATCH 31/32] Bump to version 0.0.2-4-fix-problems [skip ci] --- helm/Chart.yaml | 4 ++-- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- openapi/openapi.json | 2 +- pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 1446bad..7b8e72c 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-node-cfg-sync description: Microservice that sync api-config-cache and standin configuration type: application -version: 0.50.0 -appVersion: 0.0.2-3-fix-problems +version: 0.51.0 +appVersion: 0.0.2-4-fix-problems dependencies: - name: microservice-chart version: 2.8.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 8757692..f2a1740 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.2-3-fix-problems" + tag: "0.0.2-4-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 7236d69..2e1042f 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.2-3-fix-problems" + tag: "0.0.2-4-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index fdb1f4b..2da8a4b 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.2-3-fix-problems" + tag: "0.0.2-4-fix-problems" pullPolicy: Always livenessProbe: httpGet: diff --git a/openapi/openapi.json b/openapi/openapi.json index fd67807..ef2512a 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "title": "cfg-sync", "description": "Microservice to update configuration schema of Nodo dei Pagamenti", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.0.2-3-fix-problems" + "version": "0.0.2-4-fix-problems" }, "servers": [ { diff --git a/pom.xml b/pom.xml index 7248796..20d6adc 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ it.gov.pagopa.node cfg-sync - 0.0.2-3-fix-problems + 0.0.2-4-fix-problems Microservice to update configuration schema of Nodo dei Pagamenti From 130a33daecdc579037f0eccb35a93c7228d70af3 Mon Sep 17 00:00:00 2001 From: Francesco Cesareo Date: Tue, 2 Apr 2024 12:52:23 +0200 Subject: [PATCH 32/32] removed unused file --- .identity/02_application_action.tf | 96 ------------------- .../node-cfg-sync.postman_collection.json | 4 +- 2 files changed, 2 insertions(+), 98 deletions(-) delete mode 100644 .identity/02_application_action.tf diff --git a/.identity/02_application_action.tf b/.identity/02_application_action.tf deleted file mode 100644 index cf38593..0000000 --- a/.identity/02_application_action.tf +++ /dev/null @@ -1,96 +0,0 @@ -#module "github_runner_app" { -# source = "git::https://github.com/pagopa/github-actions-tf-modules.git//app-github-runner-creator?ref=main" -# -# app_name = local.app_name -# -# subscription_id = data.azurerm_subscription.current.id -# -# github_org = local.github.org -# github_repository = local.github.repository -# github_environment_name = var.env -# -# container_app_github_runner_env_rg = local.container_app_environment.resource_group -#} -# -#resource "null_resource" "github_runner_app_permissions_to_namespace" { -# triggers = { -# aks_id = data.azurerm_kubernetes_cluster.aks.id -# service_principal_id = module.github_runner_app.client_id -# namespace = local.domain -# version = "v2" -# } -# -# provisioner "local-exec" { -# command = <