Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: increasing consistency level of cosmos db client PAGOPA-2414 #185

Merged
merged 7 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .identity/00_data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ data "azurerm_key_vault_secret" "key_vault_sonar" {
key_vault_id = data.azurerm_key_vault.key_vault.id
}

data "azurerm_key_vault_secret" "key_vault_bot_token" {
name = "bot-token-github"
key_vault_id = data.azurerm_key_vault.key_vault.id
data "azurerm_key_vault_secret" "key_vault_bot_cd_token" {
name = "pagopa-platform-domain-github-bot-cd-pat"
key_vault_id = data.azurerm_key_vault.domain_key_vault.id
}

data "azurerm_key_vault_secret" "key_vault_cucumber_token" {
Expand Down
2 changes: 1 addition & 1 deletion .identity/03_github_environment.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ locals {
}
repo_secrets = {
"SONAR_TOKEN" : data.azurerm_key_vault_secret.key_vault_sonar.value,
"BOT_TOKEN_GITHUB" : data.azurerm_key_vault_secret.key_vault_bot_token.value,
"BOT_TOKEN_GITHUB" : data.azurerm_key_vault_secret.key_vault_bot_cd_token.value,
"CUCUMBER_PUBLISH_TOKEN" : data.azurerm_key_vault_secret.key_vault_cucumber_token.value,
"SUBKEY" : data.azurerm_key_vault_secret.key_vault_integration_test_subkey.value,
}
Expand Down
4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: pagopa-wisp-converter
description: A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, interfacing them with GPD system
type: application
version: 0.288.0
appVersion: 1.0.2
version: 0.289.0
appVersion: 1.0.2-1-PAGOPA-2414
dependencies:
- name: microservice-chart
version: 3.0.0
Expand Down
2 changes: 1 addition & 1 deletion helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart: &microservice-chart
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-wisp-converter
tag: "1.0.2"
tag: "1.0.2-1-PAGOPA-2414"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart: &microservice-chart
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-wisp-converter
tag: "1.0.2"
tag: "1.0.2-1-PAGOPA-2414"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart: &microservice-chart
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-wisp-converter
tag: "1.0.2"
tag: "1.0.2-1-PAGOPA-2414"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion openapi/openapi.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion openapi/openapi_redirect.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.0.1",
"info": {
"title": "WISP-Converter-redirect",
"version": "1.0.2"
"version": "1.0.2-1-PAGOPA-2414"
},
"servers": [
{
Expand Down
8 changes: 0 additions & 8 deletions performance-test/src/test-types/spike.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@
{
"duration": "10s",
"target": 100
},
{
"duration": "3m",
"target": 100
},
{
"duration": "10s",
"target": 0
}
],
"thresholds": {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<groupId>it.gov.pagopa</groupId>
<artifactId>wisp-converter</artifactId>
<version>1.0.2</version>
<version>1.0.2-1-PAGOPA-2414</version>
<name>pagoPA WISP Converter</name>
<description>A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, converting them in NMU payments.</description>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package it.gov.pagopa.wispconverter.config;

import com.azure.core.credential.AzureKeyCredential;
import com.azure.cosmos.ConsistencyLevel;
import com.azure.cosmos.CosmosClientBuilder;
import com.azure.cosmos.DirectConnectionConfig;
import com.azure.cosmos.GatewayConnectionConfig;
Expand Down Expand Up @@ -42,6 +43,9 @@ public class CosmosDBConfig extends AbstractCosmosConfiguration {
@Value("${azure.cosmos.populate-query-metrics}")
private Boolean cosmosQueryMetrics;

@Value("${azure.cosmos.consistency-level:SESSION}")
private String cosmosConsistencyLevel;

@Bean
public CosmosClientBuilder getCosmosClientBuilder() {
var azureKeyCredential = new AzureKeyCredential(cosmosKey);
Expand All @@ -50,6 +54,7 @@ public CosmosClientBuilder getCosmosClientBuilder() {
return new CosmosClientBuilder()
.endpoint(cosmosUri)
.credential(azureKeyCredential)
.consistencyLevel(ConsistencyLevel.valueOf(cosmosConsistencyLevel))
.directMode(directConnectionConfig, gatewayConnectionConfig);
}

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ azure.cosmos.uri=${COSMOS_URI:https://pagopa-d-weu-nodo-wispconv-cosmos-account.
azure.cosmos.key=${COSMOS_KEY:-}
azure.cosmos.populate-query-metrics=false
azure.cosmos.database=wispconverter
azure.cosmos.consistency-level=BOUNDED_STALENESS
FedericoRuzzier marked this conversation as resolved.
Show resolved Hide resolved
azure.cosmos.read.region=${COSMOS_READ_REGION:West Europe}
spring.redis.host=${REDIS_HOST:pagopa-d-redis.redis.cache.windows.net}
spring.redis.port=${REDIS_PORT:6380}
Expand Down
Loading