From 44de5f71e7de0a644de3c4b1f37be4cf510ecf23 Mon Sep 17 00:00:00 2001 From: Andrea De Rinaldis Date: Tue, 2 Jul 2024 13:19:42 +0200 Subject: [PATCH 1/8] [PAGOPA-1894] fix: add sessionIdUuid for better trace flow --- .../actors/NodoInviaCarrelloRPTActor.scala | 7 +- .../gov/pagopa/actors/NodoInviaRPTActor.scala | 6 +- .../it/gov/pagopa/common/message/Re.scala | 124 +++++++++--------- .../util/azure/cosmos/CosmosBuilder.scala | 56 ++++---- .../util/azure/cosmos/ReEventEntity.scala | 3 + 5 files changed, 103 insertions(+), 93 deletions(-) diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaCarrelloRPTActor.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaCarrelloRPTActor.scala index 37380e79..21b9b279 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaCarrelloRPTActor.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaCarrelloRPTActor.scala @@ -19,7 +19,6 @@ import it.gov.pagopa.exception.{CarrelloRptFaultBeanException, WorkflowException import org.slf4j.MDC import scalaxbmodel.nodoperpa.{IntestazioneCarrelloPPT, NodoInviaCarrelloRPT, NodoInviaCarrelloRPTRisposta} import scalaxbmodel.paginf.CtRichiestaPagamentoTelematico -import sun.nio.cs.UTF_8 import java.time.Instant import java.util.Base64 @@ -94,7 +93,8 @@ case class NodoInviaCarrelloRPTActorPerRequest(cosmosRepository: CosmosRepositor Re( componente = Componente.WISP_SOAP_CONVERTER, categoriaEvento = CategoriaEvento.INTERNAL, - sessionId = Some(req.sessionId), + sessionId = None, + sessionIdUuid = Some(req.sessionId), sessionIdOriginal = Some(req.sessionId), payload = None, esito = Esito.EXCECUTED_INTERNAL_STEP, @@ -106,7 +106,7 @@ case class NodoInviaCarrelloRPTActorPerRequest(cosmosRepository: CosmosRepositor erogatoreDescr = Some(FaultId.NODO_DEI_PAGAMENTI_SPC) ) ) - reRequest = ReRequest(req.sessionId, req.testCaseId, re.get, None) + reRequest = ReRequest(null, req.testCaseId, re.get, None) MDC.put(Constant.MDCKey.ORIGINAL_SESSION_ID, req.sessionId) @@ -119,6 +119,7 @@ case class NodoInviaCarrelloRPTActorPerRequest(cosmosRepository: CosmosRepositor _ = idCarrello = intestazioneCarrelloPPT.identificativoCarrello _ = re = re.map(r => r.copy( + sessionId = Some(RPTUtil.getUniqueKey(req, intestazioneCarrelloPPT)), idCarrello = Some(idCarrello), psp = Some(nodoInviaCarrelloRPT.identificativoPSP), canale = Some(nodoInviaCarrelloRPT.identificativoCanale), diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaRPTActor.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaRPTActor.scala index a9ef2adb..c8708390 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaRPTActor.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaRPTActor.scala @@ -92,7 +92,8 @@ case class NodoInviaRPTActorPerRequest(cosmosRepository: CosmosRepository, actor Re( componente = Componente.WISP_SOAP_CONVERTER, categoriaEvento = CategoriaEvento.INTERNAL, - sessionId = Some(req.sessionId), + sessionId = None, + sessionIdUuid = Some(req.sessionId), sessionIdOriginal = Some(req.sessionId), payload = None, esito = Esito.EXCECUTED_INTERNAL_STEP, @@ -104,7 +105,7 @@ case class NodoInviaRPTActorPerRequest(cosmosRepository: CosmosRepository, actor erogatoreDescr = Some(FaultId.NODO_DEI_PAGAMENTI_SPC) ) ) - reRequest = ReRequest(req.sessionId, req.testCaseId, re.get, None) + reRequest = ReRequest(null, req.testCaseId, re.get, None) MDC.put(Constant.MDCKey.ORIGINAL_SESSION_ID, req.sessionId) val pipeline = for { @@ -125,6 +126,7 @@ case class NodoInviaRPTActorPerRequest(cosmosRepository: CosmosRepository, actor _ = re = re.map(r => r.copy( + sessionId = Some(RPTUtil.getUniqueKey(req, intestazionePPT)), psp = Some(nodoInviaRPT.identificativoPSP), canale = Some(nodoInviaRPT.identificativoCanale), fruitore = Some(intestazionePPT.identificativoStazioneIntermediarioPA), diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/message/Re.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/message/Re.scala index 299d90e4..7fa81f5c 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/message/Re.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/message/Re.scala @@ -5,38 +5,40 @@ import it.gov.pagopa.common.util.azure.cosmos.{CategoriaEvento, Componente, Esit import net.openhft.hashing.LongHashFunction import java.time.Instant + case class Re( - insertedTimestamp: Instant, - componente: Componente.Value, - categoriaEvento: CategoriaEvento.Value, - sottoTipoEvento: SottoTipoEvento.Value, - idCarrello: Option[String] = None, - idDominio: Option[String] = None, - iuv: Option[String] = None, - ccp: Option[String] = None, - psp: Option[String] = None, - tipoVersamento: Option[String] = None, - tipoEvento: Option[String] = None, - fruitore: Option[String] = None, - erogatore: Option[String] = None, - stazione: Option[String] = None, - canale: Option[String] = None, - parametriSpecificiInterfaccia: Option[String] = None, - esito: Esito.Value, - sessionId: Option[String] = None, - status: Option[String] = None, - payload: Option[Array[Byte]] = None, - info: Option[String] = None, - businessProcess: Option[String] = None, - fruitoreDescr: Option[String] = None, - erogatoreDescr: Option[String] = None, - pspDescr: Option[String] = None, - noticeNumber: Option[String] = None, - creditorReferenceId: Option[String] = None, - paymentToken: Option[String] = None, - sessionIdOriginal: Option[String] = None, - standIn: Option[Boolean] = None -) { + insertedTimestamp: Instant, + componente: Componente.Value, + categoriaEvento: CategoriaEvento.Value, + sottoTipoEvento: SottoTipoEvento.Value, + idCarrello: Option[String] = None, + idDominio: Option[String] = None, + iuv: Option[String] = None, + ccp: Option[String] = None, + psp: Option[String] = None, + tipoVersamento: Option[String] = None, + tipoEvento: Option[String] = None, + fruitore: Option[String] = None, + erogatore: Option[String] = None, + stazione: Option[String] = None, + canale: Option[String] = None, + parametriSpecificiInterfaccia: Option[String] = None, + esito: Esito.Value, + sessionId: Option[String] = None, + sessionIdUuid: Option[String] = None, + status: Option[String] = None, + payload: Option[Array[Byte]] = None, + info: Option[String] = None, + businessProcess: Option[String] = None, + fruitoreDescr: Option[String] = None, + erogatoreDescr: Option[String] = None, + pspDescr: Option[String] = None, + noticeNumber: Option[String] = None, + creditorReferenceId: Option[String] = None, + paymentToken: Option[String] = None, + sessionIdOriginal: Option[String] = None, + standIn: Option[Boolean] = None + ) { val dataOraEvento: String = Appfunction.formatDate(insertedTimestamp) val uniqueId: String = s"${dataOraEvento.substring(0, 10)}_${ LongHashFunction @@ -64,35 +66,35 @@ case class Re( } -// def toProperties(): java.util.Map[java.lang.String, java.lang.Object] = { -// Seq( -// Some("inserted_timestamp" -> this.insertedTimestamp), -// Some("componente" -> this.componente), -// Some("categoria_evento" -> this.categoriaEvento), -// Some("sotto_tipo_evento" -> this.sottoTipoEvento), -// this.idDominio.map(v=>"id_dominio" -> v), -// this.iuv.map(v=>"iuv" -> v), -// this.ccp.map(v=>"ccp" -> v), -// this.psp.map(v=>"psp" -> v), -// this.tipoVersamento.map(v=>"tipo_versamento" -> v), -// this.tipoEvento.map(v=>"tipo_evento" -> v), -// this.fruitore.map(v=>"fruitore" -> v), -// this.erogatore.map(v=>"erogatore" -> v), -// this.stazione.map(v=>"stazione" -> v), -// this.canale.map(v=>"canale" -> v), -// this.parametriSpecificiInterfaccia.map(v=>"parametri_specifici_interfaccia" -> v), -// this.esito.map(v=>"esito" -> v), -// this.sessionId.map(v=>"session_id" -> v), -// this.status.map(v=>"status" -> v), -// this.info.map(v=>"info" -> v), -// this.businessProcess.map(v=>"business_process" -> v), -// this.fruitoreDescr.map(v=>"fruitore_descr" -> v), -// this.erogatoreDescr.map(v=>"erogatore_descr" -> v), -// this.pspDescr.map(v=>"psp_descr" -> v), -// this.noticeNumber.map(v=>"notice_number" -> v), -// this.creditorReferenceId.map(v=>"creditor_reference_id" -> v), -// this.paymentToken.map(v=>"payment_token" -> v) -// ).filter(s=>s.nonEmpty).flatten.toMap.asJava.asInstanceOf[java.util.Map[java.lang.String, java.lang.Object]] -// } + // def toProperties(): java.util.Map[java.lang.String, java.lang.Object] = { + // Seq( + // Some("inserted_timestamp" -> this.insertedTimestamp), + // Some("componente" -> this.componente), + // Some("categoria_evento" -> this.categoriaEvento), + // Some("sotto_tipo_evento" -> this.sottoTipoEvento), + // this.idDominio.map(v=>"id_dominio" -> v), + // this.iuv.map(v=>"iuv" -> v), + // this.ccp.map(v=>"ccp" -> v), + // this.psp.map(v=>"psp" -> v), + // this.tipoVersamento.map(v=>"tipo_versamento" -> v), + // this.tipoEvento.map(v=>"tipo_evento" -> v), + // this.fruitore.map(v=>"fruitore" -> v), + // this.erogatore.map(v=>"erogatore" -> v), + // this.stazione.map(v=>"stazione" -> v), + // this.canale.map(v=>"canale" -> v), + // this.parametriSpecificiInterfaccia.map(v=>"parametri_specifici_interfaccia" -> v), + // this.esito.map(v=>"esito" -> v), + // this.sessionId.map(v=>"session_id" -> v), + // this.status.map(v=>"status" -> v), + // this.info.map(v=>"info" -> v), + // this.businessProcess.map(v=>"business_process" -> v), + // this.fruitoreDescr.map(v=>"fruitore_descr" -> v), + // this.erogatoreDescr.map(v=>"erogatore_descr" -> v), + // this.pspDescr.map(v=>"psp_descr" -> v), + // this.noticeNumber.map(v=>"notice_number" -> v), + // this.creditorReferenceId.map(v=>"creditor_reference_id" -> v), + // this.paymentToken.map(v=>"payment_token" -> v) + // ).filter(s=>s.nonEmpty).flatten.toMap.asJava.asInstanceOf[java.util.Map[java.lang.String, java.lang.Object]] + // } } diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/CosmosBuilder.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/CosmosBuilder.scala index 6333b023..3ad4dc8d 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/CosmosBuilder.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/CosmosBuilder.scala @@ -18,18 +18,6 @@ import scala.util.Try case class CosmosBuilder() { - def getClient(config: Config): CosmosContainer = { - val endpoint = config.getString("azure-cosmos-events.endpoint") - val key = config.getString("azure-cosmos-events.key") - val database = config.getString("azure-cosmos-events.db-name") - val container = config.getString("azure-cosmos-events.table-name") - - new CosmosClientBuilder() - .endpoint(endpoint) - .key(key) - .buildClient().getDatabase(database).getContainer(container); - } - def build()(implicit ec: ExecutionContext, system: ActorSystem, log: AppLogger): ReEventFunc = { val cosmosContainer = getClient(system.settings.config) @@ -42,38 +30,41 @@ case class CosmosBuilder() { Future.sequence( Seq( Future(defaultOperation(request, log, reXmlLog, reJsonLog, data)), - ((for{ + ((for { _ <- Future.successful(()) item = reRequestToReEvent(request) _ = cosmosContainer.createItem(item) - } yield ())(executionContext))recoverWith { + } yield ())(executionContext)) recoverWith { case e: Throwable => log.error(e, "Error calling azure-cosmos for events") Future.failed(e) } ) - ).flatMap(_=>Future.successful(())) + ).flatMap(_ => Future.successful(())) } } - def compress(payload : Array[Byte]): Array[Byte] = { - val bais = new ByteArrayOutputStream(payload.length) - val gzipOut = new GZIPOutputStream(bais) - gzipOut.write(payload) - gzipOut.close() - val compressed = bais.toByteArray - bais.close() - compressed + def getClient(config: Config): CosmosContainer = { + val endpoint = config.getString("azure-cosmos-events.endpoint") + val key = config.getString("azure-cosmos-events.key") + val database = config.getString("azure-cosmos-events.db-name") + val container = config.getString("azure-cosmos-events.table-name") + + new CosmosClientBuilder() + .endpoint(endpoint) + .key(key) + .buildClient().getDatabase(database).getContainer(container); } + def reRequestToReEvent(request: ReRequest): ReEventEntity = { val compressedpayload = request.re.payload.map(compress) - val base64payload = compressedpayload.map(cp=>Base64.getEncoder.encodeToString(cp)) + val base64payload = compressedpayload.map(cp => Base64.getEncoder.encodeToString(cp)) - val fault: Option[(String, Option[String], Option[String])] = request.re.payload.flatMap(p=>Appfunction.getFaultFromXml(new String(p, Constant.UTF_8))) + val fault: Option[(String, Option[String], Option[String])] = request.re.payload.flatMap(p => Appfunction.getFaultFromXml(new String(p, Constant.UTF_8))) ReEventEntity( request.re.uniqueId, - request.re.insertedTimestamp.toString.substring(0,10), + request.re.insertedTimestamp.toString.substring(0, 10), null, request.sessionId, null, @@ -92,11 +83,12 @@ case class CosmosBuilder() { base64payload.orNull, //comprimere base64payload.map(_.length).map(d => new java.lang.Integer(d)).orNull, request.re.businessProcess.get, - if(fault.isDefined)"Failed" else "Success", + if (fault.isDefined) "Failed" else "Success", fault.map(_._1).orNull, fault.flatMap(_._2).orNull, fault.flatMap(_._3).orNull, request.re.tipoEvento.orNull, + request.re.sessionId.orNull, request.re.sessionIdOriginal.orNull, request.re.idCarrello.orNull, request.re.iuv.orNull, @@ -111,4 +103,14 @@ case class CosmosBuilder() { ) } + def compress(payload: Array[Byte]): Array[Byte] = { + val bais = new ByteArrayOutputStream(payload.length) + val gzipOut = new GZIPOutputStream(bais) + gzipOut.write(payload) + gzipOut.close() + val compressed = bais.toByteArray + bais.close() + compressed + } + } diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/ReEventEntity.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/ReEventEntity.scala index 1b82e333..4a58fdde 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/ReEventEntity.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/ReEventEntity.scala @@ -58,6 +58,7 @@ case class ReEventEntity( operationErrorCode: String, primitive: String, sessionId: String, + sessionIdUuid: String, cartId: String, iuv: String, noticeNumber: String, @@ -121,6 +122,8 @@ case class ReEventEntity( def getSessionId: String = sessionId + def getSessionIdUuid: String = sessionIdUuid + def getCartId: String = cartId def getIuv: String = iuv From 47c3db22fe9f55858a3c7ab99e5a235a1a18c631 Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Tue, 2 Jul 2024 11:20:48 +0000 Subject: [PATCH 2/8] Bump to version 0.2.6-79-PAGOPA-1894-fix-sessionId [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 +- version.sbt | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 9bab531e..6d20ee8f 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: wisp-soap-converter-chart description: Wisp Soap Conveter type: application -version: 2.38.0 -appVersion: 0.2.6 +version: 2.39.0 +appVersion: 0.2.6-79-PAGOPA-1894-fix-sessionId dependencies: - name: microservice-chart version: 3.0.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index f1cee885..e4d9e0a1 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -2,7 +2,7 @@ microservice-chart: µservice-chart namespace: "nodo" image: repository: ghcr.io/pagopa/pagopa-wisp-soap-converter - tag: 0.2.6 + tag: 0.2.6-79-PAGOPA-1894-fix-sessionId canaryDelivery: create: false wispsoapconverter: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index f2bf6cf6..8013bc1a 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -2,7 +2,7 @@ microservice-chart: µservice-chart namespace: "nodo" image: repository: ghcr.io/pagopa/pagopa-wisp-soap-converter - tag: 0.2.6 + tag: 0.2.6-79-PAGOPA-1894-fix-sessionId canaryDelivery: create: false wispsoapconverter: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 6ef22624..0c2b13bd 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -2,7 +2,7 @@ microservice-chart: µservice-chart namespace: "nodo" image: repository: ghcr.io/pagopa/pagopa-wisp-soap-converter - tag: 0.2.6 + tag: 0.2.6-79-PAGOPA-1894-fix-sessionId canaryDelivery: create: false wispsoapconverter: diff --git a/openapi/openapi.json b/openapi/openapi.json index e37bf721..b4ea3ce4 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "title": "Wisp soap converter", "description": "Wisp soap converter", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.2.6" + "version": "0.2.6-79-PAGOPA-1894-fix-sessionId" }, "servers": [ { diff --git a/version.sbt b/version.sbt index 149422d8..be7efc2d 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -ThisBuild / version := "0.2.6" +ThisBuild / version := "0.2.6-79-PAGOPA-1894-fix-sessionId" From 7a234abb4a2aab18b35e352f6850e51bb9a590ee Mon Sep 17 00:00:00 2001 From: Andrea De Rinaldis Date: Wed, 3 Jul 2024 09:20:51 +0200 Subject: [PATCH 3/8] [PAGOPA-1894] fix: removed sessionIdUuid and refactored sessionId set --- .../actors/NodoInviaCarrelloRPTActor.scala | 19 +- .../gov/pagopa/actors/NodoInviaRPTActor.scala | 24 ++- .../it/gov/pagopa/common/message/Re.scala | 1 - .../it/gov/pagopa/common/util/ReUtil.scala | 6 +- .../util/azure/cosmos/CosmosBuilder.scala | 1 - .../util/azure/cosmos/ReEventEntity.scala | 3 - .../soapinput/actor/SoapActorPerRequest.scala | 195 +++++++++--------- 7 files changed, 129 insertions(+), 120 deletions(-) diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaCarrelloRPTActor.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaCarrelloRPTActor.scala index 21b9b279..6e910589 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaCarrelloRPTActor.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaCarrelloRPTActor.scala @@ -44,7 +44,7 @@ case class NodoInviaCarrelloRPTActorPerRequest(cosmosRepository: CosmosRepositor case originalException: Throwable => log.debug(s"Errore generico durante InviaCarrelloRPT, message: [${originalException.getMessage}]") val cfb = CarrelloRptFaultBeanException(exception.DigitPaException(DigitPaErrorCodes.PPT_SYSTEM_ERROR, originalException), idCanale = None) - Future.successful(errorHandler(req.sessionId, req.testCaseId, cfb, re)) + Future.successful(errorHandler(MDC.get(Constant.MDCKey.SESSION_ID), req.testCaseId, cfb, re)) } val recoverPipeline: PartialFunction[Throwable, Future[SoapResponse]] = { case cfb: CarrelloRptFaultBeanException => @@ -56,20 +56,20 @@ case class NodoInviaCarrelloRPTActorPerRequest(cosmosRepository: CosmosRepositor now = Util.now() reCambioStato = re.get.copy(status = Some(StatoCarrelloEnum.CART_RIFIUTATO_NODO.toString), insertedTimestamp = now) _ = reEventFunc(reRequest.copy(re = reCambioStato), log, ddataMap) - res = errorHandler(req.sessionId, req.testCaseId, cfb, re) + res = errorHandler(MDC.get(Constant.MDCKey.SESSION_ID), req.testCaseId, cfb, re) } yield res) recoverWith recoverGenericError case _ => val cfb = CarrelloRptFaultBeanException(exception.DigitPaException(DigitPaErrorCodes.PPT_SYSTEM_ERROR), idCanale = None) - Future.successful(errorHandler(req.sessionId, req.testCaseId, cfb, re)) + Future.successful(errorHandler(MDC.get(Constant.MDCKey.SESSION_ID), req.testCaseId, cfb, re)) } } else { - Future.successful(errorHandler(req.sessionId, req.testCaseId, cfb, re)) + Future.successful(errorHandler(MDC.get(Constant.MDCKey.SESSION_ID), req.testCaseId, cfb, re)) } case e: Throwable => log.warn(e, e.getMessage) val cfb = CarrelloRptFaultBeanException(exception.DigitPaException(DigitPaErrorCodes.PPT_SYSTEM_ERROR, e), idCanale = None) - Future.successful(errorHandler(req.sessionId, req.testCaseId, cfb, re)) + Future.successful(errorHandler(MDC.get(Constant.MDCKey.SESSION_ID), req.testCaseId, cfb, re)) } var req: SoapRequest = _ var replyTo: ActorRef = _ @@ -89,12 +89,14 @@ case class NodoInviaCarrelloRPTActorPerRequest(cosmosRepository: CosmosRepositor req = soapRequest replyTo = sender() + // parachute session id, will be replaced lately when the sessionId will be generated + MDC.put(Constant.MDCKey.SESSION_ID, req.sessionId) + re = Some( Re( componente = Componente.WISP_SOAP_CONVERTER, categoriaEvento = CategoriaEvento.INTERNAL, sessionId = None, - sessionIdUuid = Some(req.sessionId), sessionIdOriginal = Some(req.sessionId), payload = None, esito = Esito.EXCECUTED_INTERNAL_STEP, @@ -117,9 +119,10 @@ case class NodoInviaCarrelloRPTActorPerRequest(cosmosRepository: CosmosRepositor _ = log.debug("Check sintattici input") (intestazioneCarrelloPPT, nodoInviaCarrelloRPT) <- Future.fromTry(parseCarrello(soapRequest.payload, inputXsdValid)) _ = idCarrello = intestazioneCarrelloPPT.identificativoCarrello + _ = MDC.put(Constant.MDCKey.SESSION_ID, RPTUtil.getUniqueKey(req, intestazioneCarrelloPPT)) _ = re = re.map(r => r.copy( - sessionId = Some(RPTUtil.getUniqueKey(req, intestazioneCarrelloPPT)), + sessionId = Some(MDC.get(Constant.MDCKey.SESSION_ID)), idCarrello = Some(idCarrello), psp = Some(nodoInviaCarrelloRPT.identificativoPSP), canale = Some(nodoInviaCarrelloRPT.identificativoCanale), @@ -236,7 +239,7 @@ case class NodoInviaCarrelloRPTActorPerRequest(cosmosRepository: CosmosRepositor } yield (payloadNodoInviaCarrelloRPTRisposta, nodoInviaCarrelloRPTRisposta) } - } yield SoapResponse(req.sessionId, payloadNodoInviaCarrelloRPTRisposta, StatusCodes.OK.intValue, re, req.testCaseId) + } yield SoapResponse(MDC.get(Constant.MDCKey.SESSION_ID), payloadNodoInviaCarrelloRPTRisposta, StatusCodes.OK.intValue, re, req.testCaseId) } def saveCarrello( diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaRPTActor.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaRPTActor.scala index c8708390..e7b9dd1c 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaRPTActor.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaRPTActor.scala @@ -43,34 +43,34 @@ case class NodoInviaRPTActorPerRequest(cosmosRepository: CosmosRepository, actor _ <- Future.successful(()) _ = reCambioStato(StatoRPTEnum.RPT_RIFIUTATA_NODO.toString, now) resItems = errorHandler(cfb) - res = SoapResponse(req.sessionId, resItems._1, StatusCodes.OK.intValue, re, req.testCaseId) + res = SoapResponse(MDC.get(Constant.MDCKey.SESSION_ID), resItems._1, StatusCodes.OK.intValue, re, req.testCaseId) } yield res) recoverWith recoverGenericError case a => log.warn(s"workflow error code non gestito [${a.toString}]") val cfb = RptFaultBeanException(exception.DigitPaException(s"workflow error code non gestito [${a.toString}]", DigitPaErrorCodes.PPT_SYSTEM_ERROR)) val resItems = errorHandler(cfb) - Future.successful(SoapResponse(req.sessionId, resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) + Future.successful(SoapResponse(MDC.get(Constant.MDCKey.SESSION_ID), resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) } } else { val resItems = errorHandler(cfb) - Future.successful(SoapResponse(req.sessionId, resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) + Future.successful(SoapResponse(MDC.get(Constant.MDCKey.SESSION_ID), resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) } case dpaex: DigitPaException => log.warn(s"Errore generico durante $actorClassId, message: [${dpaex.getMessage}]") val resItems = errorHandler(RptFaultBeanException(dpaex)) - Future.successful(SoapResponse(req.sessionId, resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) + Future.successful(SoapResponse(MDC.get(Constant.MDCKey.SESSION_ID), resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) case cause: Throwable => log.warn(cause, s"Errore generico durante $actorClassId, message: [${cause.getMessage}]") val cfb = RptFaultBeanException(exception.DigitPaException(DigitPaErrorCodes.PPT_SYSTEM_ERROR, cause)) val resItems = errorHandler(cfb) - Future.successful(SoapResponse(req.sessionId, resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) + Future.successful(SoapResponse(MDC.get(Constant.MDCKey.SESSION_ID), resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) } val recoverGenericError: PartialFunction[Throwable, Future[SoapResponse]] = { case originalException: Throwable => log.debug(s"Errore generico durante $actorClassId, message: [${originalException.getMessage}]") val cfb = RptFaultBeanException(exception.DigitPaException(DigitPaErrorCodes.PPT_SYSTEM_ERROR, originalException)) val resItems = errorHandler(cfb) - Future.successful(SoapResponse(req.sessionId, resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) + Future.successful(SoapResponse(MDC.get(Constant.MDCKey.SESSION_ID), resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) } var req: SoapRequest = _ var replyTo: ActorRef = _ @@ -88,12 +88,15 @@ case class NodoInviaRPTActorPerRequest(cosmosRepository: CosmosRepository, actor case soapRequest: SoapRequest => req = soapRequest replyTo = sender() + + // parachute session id, will be replaced lately when the sessionId will be generated + MDC.put(Constant.MDCKey.SESSION_ID, req.sessionId) + re = Some( Re( componente = Componente.WISP_SOAP_CONVERTER, categoriaEvento = CategoriaEvento.INTERNAL, sessionId = None, - sessionIdUuid = Some(req.sessionId), sessionIdOriginal = Some(req.sessionId), payload = None, esito = Esito.EXCECUTED_INTERNAL_STEP, @@ -117,6 +120,7 @@ case class NodoInviaRPTActorPerRequest(cosmosRepository: CosmosRepository, actor _ = log.debug("Input parserizzato correttamente") _ = rptKey = RPTKey(intestazionePPT.identificativoDominio, intestazionePPT.identificativoUnivocoVersamento, intestazionePPT.codiceContestoPagamento) + _ = MDC.put(Constant.MDCKey.SESSION_ID, RPTUtil.getUniqueKey(req, intestazionePPT)); _ = MDC.put(Constant.MDCKey.ID_DOMINIO, rptKey.idDominio) _ = MDC.put(Constant.MDCKey.IUV, rptKey.iuv) _ = MDC.put(Constant.MDCKey.CCP, rptKey.ccp) @@ -126,7 +130,7 @@ case class NodoInviaRPTActorPerRequest(cosmosRepository: CosmosRepository, actor _ = re = re.map(r => r.copy( - sessionId = Some(RPTUtil.getUniqueKey(req, intestazionePPT)), + sessionId = Some(MDC.get(Constant.MDCKey.SESSION_ID)), psp = Some(nodoInviaRPT.identificativoPSP), canale = Some(nodoInviaRPT.identificativoCanale), fruitore = Some(intestazionePPT.identificativoStazioneIntermediarioPA), @@ -178,7 +182,7 @@ case class NodoInviaRPTActorPerRequest(cosmosRepository: CosmosRepository, actor (payloadNodoInviaRPTRisposta, _) <- manageNormal(intestazionePPT, modelloUno, isAGID) - } yield SoapResponse(soapRequest.sessionId, payloadNodoInviaRPTRisposta, StatusCodes.OK.intValue, re, soapRequest.testCaseId) + } yield SoapResponse(MDC.get(Constant.MDCKey.SESSION_ID), payloadNodoInviaRPTRisposta, StatusCodes.OK.intValue, re, soapRequest.testCaseId) pipeline .recoverWith(recoverFuture) @@ -225,7 +229,7 @@ case class NodoInviaRPTActorPerRequest(cosmosRepository: CosmosRepository, actor def reCambioStato(stato: String, time: Instant, tipo: Option[String] = None): Unit = { reEventFunc( - ReRequest(req.sessionId, req.testCaseId, re.get.copy(status = Some(s"${tipo.getOrElse("")}${stato}"), insertedTimestamp = time, esito = Esito.EXCECUTED_INTERNAL_STEP), None), + ReRequest(MDC.get(Constant.MDCKey.SESSION_ID), req.testCaseId, re.get.copy(status = Some(s"${tipo.getOrElse("")}${stato}"), insertedTimestamp = time, esito = Esito.EXCECUTED_INTERNAL_STEP), None), log, ddataMap ) diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/message/Re.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/message/Re.scala index 7fa81f5c..f7666a0f 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/message/Re.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/message/Re.scala @@ -25,7 +25,6 @@ case class Re( parametriSpecificiInterfaccia: Option[String] = None, esito: Esito.Value, sessionId: Option[String] = None, - sessionIdUuid: Option[String] = None, status: Option[String] = None, payload: Option[Array[Byte]] = None, info: Option[String] = None, diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/ReUtil.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/ReUtil.scala index b63cd16b..9c6504e0 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/ReUtil.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/ReUtil.scala @@ -5,14 +5,16 @@ import it.gov.pagopa.common.message._ import it.gov.pagopa.common.util.ConfigUtil.ConfigData import it.gov.pagopa.common.util.azure.Appfunction.ReEventFunc import it.gov.pagopa.common.util.azure.cosmos.{CategoriaEvento, Esito, SottoTipoEvento} +import org.slf4j.MDC -trait ReUtil { this: NodoLogging => +trait ReUtil { + this: NodoLogging => def traceInterfaceRequest(message: SoapRequest, re: Re, reExtra: ReExtra, reEventFunc: ReEventFunc, ddataMap: ConfigData): Unit = { import StringUtils.Utf8String Util.logPayload(log, Some(message.payload)) val reRequestReq = ReRequest( - sessionId = message.sessionId, + sessionId = MDC.get(Constant.MDCKey.SESSION_ID), testCaseId = message.testCaseId, re = re.copy( insertedTimestamp = message.timestamp, diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/CosmosBuilder.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/CosmosBuilder.scala index 3ad4dc8d..f206853b 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/CosmosBuilder.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/CosmosBuilder.scala @@ -88,7 +88,6 @@ case class CosmosBuilder() { fault.flatMap(_._2).orNull, fault.flatMap(_._3).orNull, request.re.tipoEvento.orNull, - request.re.sessionId.orNull, request.re.sessionIdOriginal.orNull, request.re.idCarrello.orNull, request.re.iuv.orNull, diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/ReEventEntity.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/ReEventEntity.scala index 4a58fdde..1b82e333 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/ReEventEntity.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/ReEventEntity.scala @@ -58,7 +58,6 @@ case class ReEventEntity( operationErrorCode: String, primitive: String, sessionId: String, - sessionIdUuid: String, cartId: String, iuv: String, noticeNumber: String, @@ -122,8 +121,6 @@ case class ReEventEntity( def getSessionId: String = sessionId - def getSessionIdUuid: String = sessionIdUuid - def getCartId: String = cartId def getIuv: String = iuv diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/soapinput/actor/SoapActorPerRequest.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/soapinput/actor/SoapActorPerRequest.scala index 01e6fb75..d9668f20 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/soapinput/actor/SoapActorPerRequest.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/soapinput/actor/SoapActorPerRequest.scala @@ -12,7 +12,7 @@ import it.gov.pagopa.common.util.ConfigUtil.ConfigData import it.gov.pagopa.common.util.StringUtils._ import it.gov.pagopa.common.util._ import it.gov.pagopa.common.util.azure.Appfunction.ReEventFunc -import it.gov.pagopa.common.util.azure.cosmos.{CallType, CategoriaEvento, Componente, Esito, SottoTipoEvento} +import it.gov.pagopa.common.util.azure.cosmos._ import it.gov.pagopa.commonxml.XmlEnum import it.gov.pagopa.exception.SoapRouterException import it.gov.pagopa.soapinput.message.SoapRouterRequest @@ -26,22 +26,24 @@ import scala.util.{Failure, Success, Try} import scala.xml.NodeSeq class SoapActorPerRequest( - override val requestContext: RequestContext, - override val donePromise: Promise[RouteResult], - allRouters: Map[String, ActorRef], - actorProps: ActorProps -) extends FuturePerRequestActor - with ReUtil { + override val requestContext: RequestContext, + override val donePromise: Promise[RouteResult], + allRouters: Map[String, ActorRef], + actorProps: ActorProps + ) extends FuturePerRequestActor + with ReUtil { var message: SoapRouterRequest = _ var bundleResponse: SoapResponse = _ override def actorError(dpe: DigitPaException): Unit = { - MDC.put(Constant.MDCKey.SESSION_ID, message.sessionId) + if (MDC.get(Constant.MDCKey.SESSION_ID) == null) { + MDC.put(Constant.MDCKey.SESSION_ID, message.sessionId) + } MDC.put(Constant.MDCKey.SERVICE_IDENTIFIER, Constant.SERVICE_IDENTIFIER) val payload = Util.faultXmlResponse(dpe.faultCode, dpe.faultString, Some(dpe.message)) Util.logPayload(log, Some(payload)) - complete(createHttpResponse(StatusCodes.InternalServerError.intValue, payload, message.sessionId), Constant.KeyName.SOAP_INPUT) + complete(createHttpResponse(StatusCodes.InternalServerError.intValue, payload, MDC.get(Constant.MDCKey.SESSION_ID)), Constant.KeyName.SOAP_INPUT) //MDC.remove(Constant.MDCKey.SESSION_ID) } @@ -54,30 +56,6 @@ class SoapActorPerRequest( ) } - def reExtra(message: SoapRouterRequest): ReExtra = - ReExtra(callType = Some(CallType.SERVER),uri = message.uri, headers = message.headers.getOrElse(Nil), httpMethod = Some(HttpMethods.POST.toString()), callRemoteAddress = message.callRemoteAddress, soapProtocol = true) - - def traceRequest(message: SoapRouterRequest, reEventFunc: ReEventFunc, ddataMap: ConfigData): Unit = { - Util.logPayload(log, Some(message.payload)) - val reRequestReq = ReRequest( - sessionId = message.sessionId, - testCaseId = message.testCaseId, - re = Re( - componente = Componente.WISP_SOAP_CONVERTER, - categoriaEvento = CategoriaEvento.INTERFACE, - sottoTipoEvento = SottoTipoEvento.REQ, - esito = Esito.RECEIVED, - sessionId = Some(message.sessionId), - payload = Some(message.payload.getUtf8Bytes), - insertedTimestamp = message.timestamp, - erogatore = Some(FaultId.NODO_DEI_PAGAMENTI_SPC), - erogatoreDescr = Some(FaultId.NODO_DEI_PAGAMENTI_SPC) - ), - reExtra = Some(reExtra(message)) - ) - reEventFunc(reRequestReq, log, ddataMap) - } - override def receive: Receive = { case srr: SoapRouterRequest => log.debug("RECEIVE SoapRouterRequest") @@ -86,44 +64,45 @@ class SoapActorPerRequest( case sres: SoapResponse => log.debug("RECEIVE SoapResponse") - //risposta dal bundle positiva o negativa - bundleResponse = sres - - val now = Util.now() - val reRequest = ReRequest( - sessionId = sres.sessionId, - testCaseId = sres.testCaseId, - re = sres.re - .map( - _.copy( - componente = Componente.WISP_SOAP_CONVERTER, - categoriaEvento = CategoriaEvento.INTERFACE, - sottoTipoEvento = SottoTipoEvento.RESP, - esito = Esito.SEND, - payload = Some(sres.payload.getUtf8Bytes), - insertedTimestamp = now - ) - ) - .getOrElse( - Re( - componente = Componente.WISP_SOAP_CONVERTER, - categoriaEvento = CategoriaEvento.INTERFACE, - sottoTipoEvento = SottoTipoEvento.RESP, - esito = Esito.SEND, - payload = Some(sres.payload.getUtf8Bytes), - insertedTimestamp = now, - sessionId = Some(sres.sessionId), - erogatore = Some(FaultId.NODO_DEI_PAGAMENTI_SPC), - erogatoreDescr = Some(FaultId.NODO_DEI_PAGAMENTI_SPC) - ) - ), - reExtra = Some(ReExtra(callType = Some(CallType.SERVER),statusCode = Some(bundleResponse.statusCode), elapsed = Some(message.timestamp.until(now,ChronoUnit.MILLIS)), soapProtocol = true)) + //risposta dal bundle positiva o negativa + bundleResponse = sres + + val now = Util.now() + val sessionId = MDC.get(Constant.MDCKey.SESSION_ID); + val reRequest = ReRequest( + sessionId = sessionId, + testCaseId = sres.testCaseId, + re = sres.re + .map( + _.copy( + componente = Componente.WISP_SOAP_CONVERTER, + categoriaEvento = CategoriaEvento.INTERFACE, + sottoTipoEvento = SottoTipoEvento.RESP, + esito = Esito.SEND, + payload = Some(sres.payload.getUtf8Bytes), + insertedTimestamp = now + ) ) + .getOrElse( + Re( + componente = Componente.WISP_SOAP_CONVERTER, + categoriaEvento = CategoriaEvento.INTERFACE, + sottoTipoEvento = SottoTipoEvento.RESP, + esito = Esito.SEND, + payload = Some(sres.payload.getUtf8Bytes), + insertedTimestamp = now, + sessionId = Some(sessionId), + erogatore = Some(FaultId.NODO_DEI_PAGAMENTI_SPC), + erogatoreDescr = Some(FaultId.NODO_DEI_PAGAMENTI_SPC) + ) + ), + reExtra = Some(ReExtra(callType = Some(CallType.SERVER), statusCode = Some(bundleResponse.statusCode), elapsed = Some(message.timestamp.until(now, ChronoUnit.MILLIS)), soapProtocol = true)) + ) - Util.logPayload(log, Some(sres.payload)) - log.info(LogConstant.callBundle(Constant.KeyName.RE_FEEDER, isInput = false)) - actorProps.reEventFunc(reRequest, log, actorProps.ddataMap) - complete(createHttpResponse(StatusCode.int2StatusCode(bundleResponse.statusCode), bundleResponse.payload, sres.sessionId), Constant.KeyName.SOAP_INPUT) + Util.logPayload(log, Some(sres.payload)) + log.info(LogConstant.callBundle(Constant.KeyName.RE_FEEDER, isInput = false)) + actorProps.reEventFunc(reRequest, log, actorProps.ddataMap) + complete(createHttpResponse(StatusCode.int2StatusCode(bundleResponse.statusCode), bundleResponse.payload, MDC.get(Constant.MDCKey.SESSION_ID)), Constant.KeyName.SOAP_INPUT) } def sendToBundle(message: SoapRouterRequest): Try[Unit] = { @@ -131,6 +110,7 @@ class SoapActorPerRequest( val noOperation = ("Operazione non leggibile da SOAPAction o Body", "soap:Client", "NO_OPERATION") val soapActionErrata = (DigitPaErrorCodes.description(DigitPaErrorCodes.PPT_SOAPACTION_ERRATA), DigitPaErrorCodes.description(DigitPaErrorCodes.PPT_SOAPACTION_ERRATA), DigitPaErrorCodes.PPT_SOAPACTION_ERRATA) + val sessionId = MDC.get(Constant.MDCKey.SESSION_ID); (for { xml <- Try(XmlEnum.parseXmlString(message.payload)).recover({ case e: Throwable => @@ -158,30 +138,30 @@ class SoapActorPerRequest( sender: String = extractSender(xml, xpath._1).getOrElse("n/d") routername = Util.getActorRouterName(primitiva, Some(sender)) router: ActorRef = - allRouters.get(routername) match { - case Some(routerObj) => - log.debug(s"ROUTER for [$primitiva - $sender] FOUND [${routerObj.path}]") - routerObj - - case None => - allRouters.get(BootstrapUtil.actorRouter(primitiva)) match { - case Some(defaultRouter) => - log.debug(s"ROUTER for [$primitiva - DEFAULT] FOUND [${defaultRouter.path}]") - defaultRouter - case None => - log.error(s"ROUTER for [$primitiva] not found") - val dpe = exception.DigitPaException(DigitPaErrorCodes.PPT_SYSTEM_ERROR) - throw dpe - } + allRouters.get(routername) match { + case Some(routerObj) => + log.debug(s"ROUTER for [$primitiva - $sender] FOUND [${routerObj.path}]") + routerObj + + case None => + allRouters.get(BootstrapUtil.actorRouter(primitiva)) match { + case Some(defaultRouter) => + log.debug(s"ROUTER for [$primitiva - DEFAULT] FOUND [${defaultRouter.path}]") + defaultRouter + case None => + log.error(s"ROUTER for [$primitiva] not found") + val dpe = exception.DigitPaException(DigitPaErrorCodes.PPT_SYSTEM_ERROR) + throw dpe + } } soapRequest = SoapRequest( - message.sessionId, + sessionId, message.payload, message.callRemoteAddress.getOrElse(""), primitiva, sender, message.timestamp, - reExtra(message),false, + reExtra(message), false, message.testCaseId ) } yield (router, soapRequest)) map { case (router, soapRequest) => @@ -197,27 +177,27 @@ class SoapActorPerRequest( val now = Util.now() val reRequestResp = ReRequest( - sessionId = message.sessionId, + sessionId = sessionId, testCaseId = message.testCaseId, re = Re( componente = Componente.WISP_SOAP_CONVERTER, categoriaEvento = CategoriaEvento.INTERFACE, sottoTipoEvento = SottoTipoEvento.RESP, esito = Esito.SEND_FAILURE, - sessionId = Some(message.sessionId), + sessionId = Some(sessionId), payload = Some(payload.getUtf8Bytes), insertedTimestamp = now ), - reExtra = Some(ReExtra(callType = Some(CallType.SERVER),statusCode = Some(sre.statusCode), elapsed = Some(message.timestamp.until(now,ChronoUnit.MILLIS)), soapProtocol = true)) + reExtra = Some(ReExtra(callType = Some(CallType.SERVER), statusCode = Some(sre.statusCode), elapsed = Some(message.timestamp.until(now, ChronoUnit.MILLIS)), soapProtocol = true)) ) actorProps.reEventFunc(reRequestResp, log, actorProps.ddataMap) - complete(createHttpResponse(sre.statusCode, payload, message.sessionId), Constant.KeyName.SOAP_INPUT) + complete(createHttpResponse(sre.statusCode, payload, sessionId), Constant.KeyName.SOAP_INPUT) case e: Throwable => log.error(e, "General Error Throwable") - traceRequest(message,actorProps.reEventFunc, actorProps.ddataMap) + traceRequest(message, actorProps.reEventFunc, actorProps.ddataMap) val dpe = exception.DigitPaException(DigitPaErrorCodes.PPT_SYSTEM_ERROR) val payload = Util.faultXmlResponse(dpe.faultCode, dpe.faultString, Some(dpe.message)) @@ -225,24 +205,49 @@ class SoapActorPerRequest( val now = Util.now() val reRequest = ReRequest( - sessionId = message.sessionId, + sessionId = sessionId, testCaseId = message.testCaseId, re = Re( componente = Componente.WISP_SOAP_CONVERTER, categoriaEvento = CategoriaEvento.INTERFACE, sottoTipoEvento = SottoTipoEvento.RESP, esito = Esito.SEND_FAILURE, - sessionId = Some(message.sessionId), + sessionId = Some(sessionId), payload = Some(payload.getUtf8Bytes), insertedTimestamp = now ), - reExtra = Some(ReExtra(callType = Some(CallType.SERVER),statusCode = Some(StatusCodes.InternalServerError.intValue), elapsed = Some(message.timestamp.until(now,ChronoUnit.MILLIS)), soapProtocol = true)) + reExtra = Some(ReExtra(callType = Some(CallType.SERVER), statusCode = Some(StatusCodes.InternalServerError.intValue), elapsed = Some(message.timestamp.until(now, ChronoUnit.MILLIS)), soapProtocol = true)) ) actorProps.reEventFunc(reRequest, log, actorProps.ddataMap) - complete(createHttpResponse(StatusCodes.InternalServerError.intValue, payload, message.sessionId), Constant.KeyName.SOAP_INPUT) + complete(createHttpResponse(StatusCodes.InternalServerError.intValue, payload, sessionId), Constant.KeyName.SOAP_INPUT) } } + def traceRequest(message: SoapRouterRequest, reEventFunc: ReEventFunc, ddataMap: ConfigData): Unit = { + Util.logPayload(log, Some(message.payload)) + val sessionId = MDC.get(Constant.MDCKey.SESSION_ID); + val reRequestReq = ReRequest( + sessionId = sessionId, + testCaseId = message.testCaseId, + re = Re( + componente = Componente.WISP_SOAP_CONVERTER, + categoriaEvento = CategoriaEvento.INTERFACE, + sottoTipoEvento = SottoTipoEvento.REQ, + esito = Esito.RECEIVED, + sessionId = Some(sessionId), + payload = Some(message.payload.getUtf8Bytes), + insertedTimestamp = message.timestamp, + erogatore = Some(FaultId.NODO_DEI_PAGAMENTI_SPC), + erogatoreDescr = Some(FaultId.NODO_DEI_PAGAMENTI_SPC) + ), + reExtra = Some(reExtra(message)) + ) + reEventFunc(reRequestReq, log, ddataMap) + } + + def reExtra(message: SoapRouterRequest): ReExtra = + ReExtra(callType = Some(CallType.SERVER), uri = message.uri, headers = message.headers.getOrElse(Nil), httpMethod = Some(HttpMethods.POST.toString()), callRemoteAddress = message.callRemoteAddress, soapProtocol = true) + private def extractSender(xml: NodeSeq, path: String): Try[String] = { path.split("/").foldLeft[Try[NodeSeq]](Try(xml))((nodeOption, element) => nodeOption.flatMap(node => Try(node \ element))).flatMap(resultNode => Try(resultNode.head.text)) } From 240a9e6d38c3f103de24fd91c44a296714b0bdf4 Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Wed, 3 Jul 2024 07:22:33 +0000 Subject: [PATCH 4/8] Bump to version 0.2.6-82-PAGOPA-1894-fix-sessionId [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 +- version.sbt | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 6d20ee8f..72d896c0 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: wisp-soap-converter-chart description: Wisp Soap Conveter type: application -version: 2.39.0 -appVersion: 0.2.6-79-PAGOPA-1894-fix-sessionId +version: 2.40.0 +appVersion: 0.2.6-82-PAGOPA-1894-fix-sessionId dependencies: - name: microservice-chart version: 3.0.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index e4d9e0a1..01262347 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -2,7 +2,7 @@ microservice-chart: µservice-chart namespace: "nodo" image: repository: ghcr.io/pagopa/pagopa-wisp-soap-converter - tag: 0.2.6-79-PAGOPA-1894-fix-sessionId + tag: 0.2.6-82-PAGOPA-1894-fix-sessionId canaryDelivery: create: false wispsoapconverter: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 8013bc1a..9a0afd6c 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -2,7 +2,7 @@ microservice-chart: µservice-chart namespace: "nodo" image: repository: ghcr.io/pagopa/pagopa-wisp-soap-converter - tag: 0.2.6-79-PAGOPA-1894-fix-sessionId + tag: 0.2.6-82-PAGOPA-1894-fix-sessionId canaryDelivery: create: false wispsoapconverter: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 0c2b13bd..ebd72a7b 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -2,7 +2,7 @@ microservice-chart: µservice-chart namespace: "nodo" image: repository: ghcr.io/pagopa/pagopa-wisp-soap-converter - tag: 0.2.6-79-PAGOPA-1894-fix-sessionId + tag: 0.2.6-82-PAGOPA-1894-fix-sessionId canaryDelivery: create: false wispsoapconverter: diff --git a/openapi/openapi.json b/openapi/openapi.json index b4ea3ce4..c51558f8 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "title": "Wisp soap converter", "description": "Wisp soap converter", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.2.6-79-PAGOPA-1894-fix-sessionId" + "version": "0.2.6-82-PAGOPA-1894-fix-sessionId" }, "servers": [ { diff --git a/version.sbt b/version.sbt index be7efc2d..b72dfa30 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -ThisBuild / version := "0.2.6-79-PAGOPA-1894-fix-sessionId" +ThisBuild / version := "0.2.6-82-PAGOPA-1894-fix-sessionId" From fc18dd8982907240bc21588701300385e713b223 Mon Sep 17 00:00:00 2001 From: Andrea De Rinaldis Date: Wed, 3 Jul 2024 09:39:24 +0200 Subject: [PATCH 5/8] Revert "[PAGOPA-1894] fix: removed sessionIdUuid and refactored sessionId set" This reverts commit 7a234abb4a2aab18b35e352f6850e51bb9a590ee. --- .../actors/NodoInviaCarrelloRPTActor.scala | 19 +- .../gov/pagopa/actors/NodoInviaRPTActor.scala | 24 +-- .../it/gov/pagopa/common/message/Re.scala | 1 + .../it/gov/pagopa/common/util/ReUtil.scala | 6 +- .../util/azure/cosmos/CosmosBuilder.scala | 1 + .../util/azure/cosmos/ReEventEntity.scala | 3 + .../soapinput/actor/SoapActorPerRequest.scala | 195 +++++++++--------- 7 files changed, 120 insertions(+), 129 deletions(-) diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaCarrelloRPTActor.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaCarrelloRPTActor.scala index 6e910589..21b9b279 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaCarrelloRPTActor.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaCarrelloRPTActor.scala @@ -44,7 +44,7 @@ case class NodoInviaCarrelloRPTActorPerRequest(cosmosRepository: CosmosRepositor case originalException: Throwable => log.debug(s"Errore generico durante InviaCarrelloRPT, message: [${originalException.getMessage}]") val cfb = CarrelloRptFaultBeanException(exception.DigitPaException(DigitPaErrorCodes.PPT_SYSTEM_ERROR, originalException), idCanale = None) - Future.successful(errorHandler(MDC.get(Constant.MDCKey.SESSION_ID), req.testCaseId, cfb, re)) + Future.successful(errorHandler(req.sessionId, req.testCaseId, cfb, re)) } val recoverPipeline: PartialFunction[Throwable, Future[SoapResponse]] = { case cfb: CarrelloRptFaultBeanException => @@ -56,20 +56,20 @@ case class NodoInviaCarrelloRPTActorPerRequest(cosmosRepository: CosmosRepositor now = Util.now() reCambioStato = re.get.copy(status = Some(StatoCarrelloEnum.CART_RIFIUTATO_NODO.toString), insertedTimestamp = now) _ = reEventFunc(reRequest.copy(re = reCambioStato), log, ddataMap) - res = errorHandler(MDC.get(Constant.MDCKey.SESSION_ID), req.testCaseId, cfb, re) + res = errorHandler(req.sessionId, req.testCaseId, cfb, re) } yield res) recoverWith recoverGenericError case _ => val cfb = CarrelloRptFaultBeanException(exception.DigitPaException(DigitPaErrorCodes.PPT_SYSTEM_ERROR), idCanale = None) - Future.successful(errorHandler(MDC.get(Constant.MDCKey.SESSION_ID), req.testCaseId, cfb, re)) + Future.successful(errorHandler(req.sessionId, req.testCaseId, cfb, re)) } } else { - Future.successful(errorHandler(MDC.get(Constant.MDCKey.SESSION_ID), req.testCaseId, cfb, re)) + Future.successful(errorHandler(req.sessionId, req.testCaseId, cfb, re)) } case e: Throwable => log.warn(e, e.getMessage) val cfb = CarrelloRptFaultBeanException(exception.DigitPaException(DigitPaErrorCodes.PPT_SYSTEM_ERROR, e), idCanale = None) - Future.successful(errorHandler(MDC.get(Constant.MDCKey.SESSION_ID), req.testCaseId, cfb, re)) + Future.successful(errorHandler(req.sessionId, req.testCaseId, cfb, re)) } var req: SoapRequest = _ var replyTo: ActorRef = _ @@ -89,14 +89,12 @@ case class NodoInviaCarrelloRPTActorPerRequest(cosmosRepository: CosmosRepositor req = soapRequest replyTo = sender() - // parachute session id, will be replaced lately when the sessionId will be generated - MDC.put(Constant.MDCKey.SESSION_ID, req.sessionId) - re = Some( Re( componente = Componente.WISP_SOAP_CONVERTER, categoriaEvento = CategoriaEvento.INTERNAL, sessionId = None, + sessionIdUuid = Some(req.sessionId), sessionIdOriginal = Some(req.sessionId), payload = None, esito = Esito.EXCECUTED_INTERNAL_STEP, @@ -119,10 +117,9 @@ case class NodoInviaCarrelloRPTActorPerRequest(cosmosRepository: CosmosRepositor _ = log.debug("Check sintattici input") (intestazioneCarrelloPPT, nodoInviaCarrelloRPT) <- Future.fromTry(parseCarrello(soapRequest.payload, inputXsdValid)) _ = idCarrello = intestazioneCarrelloPPT.identificativoCarrello - _ = MDC.put(Constant.MDCKey.SESSION_ID, RPTUtil.getUniqueKey(req, intestazioneCarrelloPPT)) _ = re = re.map(r => r.copy( - sessionId = Some(MDC.get(Constant.MDCKey.SESSION_ID)), + sessionId = Some(RPTUtil.getUniqueKey(req, intestazioneCarrelloPPT)), idCarrello = Some(idCarrello), psp = Some(nodoInviaCarrelloRPT.identificativoPSP), canale = Some(nodoInviaCarrelloRPT.identificativoCanale), @@ -239,7 +236,7 @@ case class NodoInviaCarrelloRPTActorPerRequest(cosmosRepository: CosmosRepositor } yield (payloadNodoInviaCarrelloRPTRisposta, nodoInviaCarrelloRPTRisposta) } - } yield SoapResponse(MDC.get(Constant.MDCKey.SESSION_ID), payloadNodoInviaCarrelloRPTRisposta, StatusCodes.OK.intValue, re, req.testCaseId) + } yield SoapResponse(req.sessionId, payloadNodoInviaCarrelloRPTRisposta, StatusCodes.OK.intValue, re, req.testCaseId) } def saveCarrello( diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaRPTActor.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaRPTActor.scala index e7b9dd1c..c8708390 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaRPTActor.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaRPTActor.scala @@ -43,34 +43,34 @@ case class NodoInviaRPTActorPerRequest(cosmosRepository: CosmosRepository, actor _ <- Future.successful(()) _ = reCambioStato(StatoRPTEnum.RPT_RIFIUTATA_NODO.toString, now) resItems = errorHandler(cfb) - res = SoapResponse(MDC.get(Constant.MDCKey.SESSION_ID), resItems._1, StatusCodes.OK.intValue, re, req.testCaseId) + res = SoapResponse(req.sessionId, resItems._1, StatusCodes.OK.intValue, re, req.testCaseId) } yield res) recoverWith recoverGenericError case a => log.warn(s"workflow error code non gestito [${a.toString}]") val cfb = RptFaultBeanException(exception.DigitPaException(s"workflow error code non gestito [${a.toString}]", DigitPaErrorCodes.PPT_SYSTEM_ERROR)) val resItems = errorHandler(cfb) - Future.successful(SoapResponse(MDC.get(Constant.MDCKey.SESSION_ID), resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) + Future.successful(SoapResponse(req.sessionId, resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) } } else { val resItems = errorHandler(cfb) - Future.successful(SoapResponse(MDC.get(Constant.MDCKey.SESSION_ID), resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) + Future.successful(SoapResponse(req.sessionId, resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) } case dpaex: DigitPaException => log.warn(s"Errore generico durante $actorClassId, message: [${dpaex.getMessage}]") val resItems = errorHandler(RptFaultBeanException(dpaex)) - Future.successful(SoapResponse(MDC.get(Constant.MDCKey.SESSION_ID), resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) + Future.successful(SoapResponse(req.sessionId, resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) case cause: Throwable => log.warn(cause, s"Errore generico durante $actorClassId, message: [${cause.getMessage}]") val cfb = RptFaultBeanException(exception.DigitPaException(DigitPaErrorCodes.PPT_SYSTEM_ERROR, cause)) val resItems = errorHandler(cfb) - Future.successful(SoapResponse(MDC.get(Constant.MDCKey.SESSION_ID), resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) + Future.successful(SoapResponse(req.sessionId, resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) } val recoverGenericError: PartialFunction[Throwable, Future[SoapResponse]] = { case originalException: Throwable => log.debug(s"Errore generico durante $actorClassId, message: [${originalException.getMessage}]") val cfb = RptFaultBeanException(exception.DigitPaException(DigitPaErrorCodes.PPT_SYSTEM_ERROR, originalException)) val resItems = errorHandler(cfb) - Future.successful(SoapResponse(MDC.get(Constant.MDCKey.SESSION_ID), resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) + Future.successful(SoapResponse(req.sessionId, resItems._1, StatusCodes.OK.intValue, re, req.testCaseId)) } var req: SoapRequest = _ var replyTo: ActorRef = _ @@ -88,15 +88,12 @@ case class NodoInviaRPTActorPerRequest(cosmosRepository: CosmosRepository, actor case soapRequest: SoapRequest => req = soapRequest replyTo = sender() - - // parachute session id, will be replaced lately when the sessionId will be generated - MDC.put(Constant.MDCKey.SESSION_ID, req.sessionId) - re = Some( Re( componente = Componente.WISP_SOAP_CONVERTER, categoriaEvento = CategoriaEvento.INTERNAL, sessionId = None, + sessionIdUuid = Some(req.sessionId), sessionIdOriginal = Some(req.sessionId), payload = None, esito = Esito.EXCECUTED_INTERNAL_STEP, @@ -120,7 +117,6 @@ case class NodoInviaRPTActorPerRequest(cosmosRepository: CosmosRepository, actor _ = log.debug("Input parserizzato correttamente") _ = rptKey = RPTKey(intestazionePPT.identificativoDominio, intestazionePPT.identificativoUnivocoVersamento, intestazionePPT.codiceContestoPagamento) - _ = MDC.put(Constant.MDCKey.SESSION_ID, RPTUtil.getUniqueKey(req, intestazionePPT)); _ = MDC.put(Constant.MDCKey.ID_DOMINIO, rptKey.idDominio) _ = MDC.put(Constant.MDCKey.IUV, rptKey.iuv) _ = MDC.put(Constant.MDCKey.CCP, rptKey.ccp) @@ -130,7 +126,7 @@ case class NodoInviaRPTActorPerRequest(cosmosRepository: CosmosRepository, actor _ = re = re.map(r => r.copy( - sessionId = Some(MDC.get(Constant.MDCKey.SESSION_ID)), + sessionId = Some(RPTUtil.getUniqueKey(req, intestazionePPT)), psp = Some(nodoInviaRPT.identificativoPSP), canale = Some(nodoInviaRPT.identificativoCanale), fruitore = Some(intestazionePPT.identificativoStazioneIntermediarioPA), @@ -182,7 +178,7 @@ case class NodoInviaRPTActorPerRequest(cosmosRepository: CosmosRepository, actor (payloadNodoInviaRPTRisposta, _) <- manageNormal(intestazionePPT, modelloUno, isAGID) - } yield SoapResponse(MDC.get(Constant.MDCKey.SESSION_ID), payloadNodoInviaRPTRisposta, StatusCodes.OK.intValue, re, soapRequest.testCaseId) + } yield SoapResponse(soapRequest.sessionId, payloadNodoInviaRPTRisposta, StatusCodes.OK.intValue, re, soapRequest.testCaseId) pipeline .recoverWith(recoverFuture) @@ -229,7 +225,7 @@ case class NodoInviaRPTActorPerRequest(cosmosRepository: CosmosRepository, actor def reCambioStato(stato: String, time: Instant, tipo: Option[String] = None): Unit = { reEventFunc( - ReRequest(MDC.get(Constant.MDCKey.SESSION_ID), req.testCaseId, re.get.copy(status = Some(s"${tipo.getOrElse("")}${stato}"), insertedTimestamp = time, esito = Esito.EXCECUTED_INTERNAL_STEP), None), + ReRequest(req.sessionId, req.testCaseId, re.get.copy(status = Some(s"${tipo.getOrElse("")}${stato}"), insertedTimestamp = time, esito = Esito.EXCECUTED_INTERNAL_STEP), None), log, ddataMap ) diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/message/Re.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/message/Re.scala index f7666a0f..7fa81f5c 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/message/Re.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/message/Re.scala @@ -25,6 +25,7 @@ case class Re( parametriSpecificiInterfaccia: Option[String] = None, esito: Esito.Value, sessionId: Option[String] = None, + sessionIdUuid: Option[String] = None, status: Option[String] = None, payload: Option[Array[Byte]] = None, info: Option[String] = None, diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/ReUtil.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/ReUtil.scala index 9c6504e0..b63cd16b 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/ReUtil.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/ReUtil.scala @@ -5,16 +5,14 @@ import it.gov.pagopa.common.message._ import it.gov.pagopa.common.util.ConfigUtil.ConfigData import it.gov.pagopa.common.util.azure.Appfunction.ReEventFunc import it.gov.pagopa.common.util.azure.cosmos.{CategoriaEvento, Esito, SottoTipoEvento} -import org.slf4j.MDC -trait ReUtil { - this: NodoLogging => +trait ReUtil { this: NodoLogging => def traceInterfaceRequest(message: SoapRequest, re: Re, reExtra: ReExtra, reEventFunc: ReEventFunc, ddataMap: ConfigData): Unit = { import StringUtils.Utf8String Util.logPayload(log, Some(message.payload)) val reRequestReq = ReRequest( - sessionId = MDC.get(Constant.MDCKey.SESSION_ID), + sessionId = message.sessionId, testCaseId = message.testCaseId, re = re.copy( insertedTimestamp = message.timestamp, diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/CosmosBuilder.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/CosmosBuilder.scala index f206853b..3ad4dc8d 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/CosmosBuilder.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/CosmosBuilder.scala @@ -88,6 +88,7 @@ case class CosmosBuilder() { fault.flatMap(_._2).orNull, fault.flatMap(_._3).orNull, request.re.tipoEvento.orNull, + request.re.sessionId.orNull, request.re.sessionIdOriginal.orNull, request.re.idCarrello.orNull, request.re.iuv.orNull, diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/ReEventEntity.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/ReEventEntity.scala index 1b82e333..4a58fdde 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/ReEventEntity.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/ReEventEntity.scala @@ -58,6 +58,7 @@ case class ReEventEntity( operationErrorCode: String, primitive: String, sessionId: String, + sessionIdUuid: String, cartId: String, iuv: String, noticeNumber: String, @@ -121,6 +122,8 @@ case class ReEventEntity( def getSessionId: String = sessionId + def getSessionIdUuid: String = sessionIdUuid + def getCartId: String = cartId def getIuv: String = iuv diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/soapinput/actor/SoapActorPerRequest.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/soapinput/actor/SoapActorPerRequest.scala index d9668f20..01e6fb75 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/soapinput/actor/SoapActorPerRequest.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/soapinput/actor/SoapActorPerRequest.scala @@ -12,7 +12,7 @@ import it.gov.pagopa.common.util.ConfigUtil.ConfigData import it.gov.pagopa.common.util.StringUtils._ import it.gov.pagopa.common.util._ import it.gov.pagopa.common.util.azure.Appfunction.ReEventFunc -import it.gov.pagopa.common.util.azure.cosmos._ +import it.gov.pagopa.common.util.azure.cosmos.{CallType, CategoriaEvento, Componente, Esito, SottoTipoEvento} import it.gov.pagopa.commonxml.XmlEnum import it.gov.pagopa.exception.SoapRouterException import it.gov.pagopa.soapinput.message.SoapRouterRequest @@ -26,24 +26,22 @@ import scala.util.{Failure, Success, Try} import scala.xml.NodeSeq class SoapActorPerRequest( - override val requestContext: RequestContext, - override val donePromise: Promise[RouteResult], - allRouters: Map[String, ActorRef], - actorProps: ActorProps - ) extends FuturePerRequestActor - with ReUtil { + override val requestContext: RequestContext, + override val donePromise: Promise[RouteResult], + allRouters: Map[String, ActorRef], + actorProps: ActorProps +) extends FuturePerRequestActor + with ReUtil { var message: SoapRouterRequest = _ var bundleResponse: SoapResponse = _ override def actorError(dpe: DigitPaException): Unit = { - if (MDC.get(Constant.MDCKey.SESSION_ID) == null) { - MDC.put(Constant.MDCKey.SESSION_ID, message.sessionId) - } + MDC.put(Constant.MDCKey.SESSION_ID, message.sessionId) MDC.put(Constant.MDCKey.SERVICE_IDENTIFIER, Constant.SERVICE_IDENTIFIER) val payload = Util.faultXmlResponse(dpe.faultCode, dpe.faultString, Some(dpe.message)) Util.logPayload(log, Some(payload)) - complete(createHttpResponse(StatusCodes.InternalServerError.intValue, payload, MDC.get(Constant.MDCKey.SESSION_ID)), Constant.KeyName.SOAP_INPUT) + complete(createHttpResponse(StatusCodes.InternalServerError.intValue, payload, message.sessionId), Constant.KeyName.SOAP_INPUT) //MDC.remove(Constant.MDCKey.SESSION_ID) } @@ -56,6 +54,30 @@ class SoapActorPerRequest( ) } + def reExtra(message: SoapRouterRequest): ReExtra = + ReExtra(callType = Some(CallType.SERVER),uri = message.uri, headers = message.headers.getOrElse(Nil), httpMethod = Some(HttpMethods.POST.toString()), callRemoteAddress = message.callRemoteAddress, soapProtocol = true) + + def traceRequest(message: SoapRouterRequest, reEventFunc: ReEventFunc, ddataMap: ConfigData): Unit = { + Util.logPayload(log, Some(message.payload)) + val reRequestReq = ReRequest( + sessionId = message.sessionId, + testCaseId = message.testCaseId, + re = Re( + componente = Componente.WISP_SOAP_CONVERTER, + categoriaEvento = CategoriaEvento.INTERFACE, + sottoTipoEvento = SottoTipoEvento.REQ, + esito = Esito.RECEIVED, + sessionId = Some(message.sessionId), + payload = Some(message.payload.getUtf8Bytes), + insertedTimestamp = message.timestamp, + erogatore = Some(FaultId.NODO_DEI_PAGAMENTI_SPC), + erogatoreDescr = Some(FaultId.NODO_DEI_PAGAMENTI_SPC) + ), + reExtra = Some(reExtra(message)) + ) + reEventFunc(reRequestReq, log, ddataMap) + } + override def receive: Receive = { case srr: SoapRouterRequest => log.debug("RECEIVE SoapRouterRequest") @@ -64,45 +86,44 @@ class SoapActorPerRequest( case sres: SoapResponse => log.debug("RECEIVE SoapResponse") - //risposta dal bundle positiva o negativa - bundleResponse = sres - - val now = Util.now() - val sessionId = MDC.get(Constant.MDCKey.SESSION_ID); - val reRequest = ReRequest( - sessionId = sessionId, - testCaseId = sres.testCaseId, - re = sres.re - .map( - _.copy( - componente = Componente.WISP_SOAP_CONVERTER, - categoriaEvento = CategoriaEvento.INTERFACE, - sottoTipoEvento = SottoTipoEvento.RESP, - esito = Esito.SEND, - payload = Some(sres.payload.getUtf8Bytes), - insertedTimestamp = now - ) + //risposta dal bundle positiva o negativa + bundleResponse = sres + + val now = Util.now() + val reRequest = ReRequest( + sessionId = sres.sessionId, + testCaseId = sres.testCaseId, + re = sres.re + .map( + _.copy( + componente = Componente.WISP_SOAP_CONVERTER, + categoriaEvento = CategoriaEvento.INTERFACE, + sottoTipoEvento = SottoTipoEvento.RESP, + esito = Esito.SEND, + payload = Some(sres.payload.getUtf8Bytes), + insertedTimestamp = now + ) + ) + .getOrElse( + Re( + componente = Componente.WISP_SOAP_CONVERTER, + categoriaEvento = CategoriaEvento.INTERFACE, + sottoTipoEvento = SottoTipoEvento.RESP, + esito = Esito.SEND, + payload = Some(sres.payload.getUtf8Bytes), + insertedTimestamp = now, + sessionId = Some(sres.sessionId), + erogatore = Some(FaultId.NODO_DEI_PAGAMENTI_SPC), + erogatoreDescr = Some(FaultId.NODO_DEI_PAGAMENTI_SPC) + ) + ), + reExtra = Some(ReExtra(callType = Some(CallType.SERVER),statusCode = Some(bundleResponse.statusCode), elapsed = Some(message.timestamp.until(now,ChronoUnit.MILLIS)), soapProtocol = true)) ) - .getOrElse( - Re( - componente = Componente.WISP_SOAP_CONVERTER, - categoriaEvento = CategoriaEvento.INTERFACE, - sottoTipoEvento = SottoTipoEvento.RESP, - esito = Esito.SEND, - payload = Some(sres.payload.getUtf8Bytes), - insertedTimestamp = now, - sessionId = Some(sessionId), - erogatore = Some(FaultId.NODO_DEI_PAGAMENTI_SPC), - erogatoreDescr = Some(FaultId.NODO_DEI_PAGAMENTI_SPC) - ) - ), - reExtra = Some(ReExtra(callType = Some(CallType.SERVER), statusCode = Some(bundleResponse.statusCode), elapsed = Some(message.timestamp.until(now, ChronoUnit.MILLIS)), soapProtocol = true)) - ) - Util.logPayload(log, Some(sres.payload)) - log.info(LogConstant.callBundle(Constant.KeyName.RE_FEEDER, isInput = false)) - actorProps.reEventFunc(reRequest, log, actorProps.ddataMap) - complete(createHttpResponse(StatusCode.int2StatusCode(bundleResponse.statusCode), bundleResponse.payload, MDC.get(Constant.MDCKey.SESSION_ID)), Constant.KeyName.SOAP_INPUT) + Util.logPayload(log, Some(sres.payload)) + log.info(LogConstant.callBundle(Constant.KeyName.RE_FEEDER, isInput = false)) + actorProps.reEventFunc(reRequest, log, actorProps.ddataMap) + complete(createHttpResponse(StatusCode.int2StatusCode(bundleResponse.statusCode), bundleResponse.payload, sres.sessionId), Constant.KeyName.SOAP_INPUT) } def sendToBundle(message: SoapRouterRequest): Try[Unit] = { @@ -110,7 +131,6 @@ class SoapActorPerRequest( val noOperation = ("Operazione non leggibile da SOAPAction o Body", "soap:Client", "NO_OPERATION") val soapActionErrata = (DigitPaErrorCodes.description(DigitPaErrorCodes.PPT_SOAPACTION_ERRATA), DigitPaErrorCodes.description(DigitPaErrorCodes.PPT_SOAPACTION_ERRATA), DigitPaErrorCodes.PPT_SOAPACTION_ERRATA) - val sessionId = MDC.get(Constant.MDCKey.SESSION_ID); (for { xml <- Try(XmlEnum.parseXmlString(message.payload)).recover({ case e: Throwable => @@ -138,30 +158,30 @@ class SoapActorPerRequest( sender: String = extractSender(xml, xpath._1).getOrElse("n/d") routername = Util.getActorRouterName(primitiva, Some(sender)) router: ActorRef = - allRouters.get(routername) match { - case Some(routerObj) => - log.debug(s"ROUTER for [$primitiva - $sender] FOUND [${routerObj.path}]") - routerObj - - case None => - allRouters.get(BootstrapUtil.actorRouter(primitiva)) match { - case Some(defaultRouter) => - log.debug(s"ROUTER for [$primitiva - DEFAULT] FOUND [${defaultRouter.path}]") - defaultRouter - case None => - log.error(s"ROUTER for [$primitiva] not found") - val dpe = exception.DigitPaException(DigitPaErrorCodes.PPT_SYSTEM_ERROR) - throw dpe - } + allRouters.get(routername) match { + case Some(routerObj) => + log.debug(s"ROUTER for [$primitiva - $sender] FOUND [${routerObj.path}]") + routerObj + + case None => + allRouters.get(BootstrapUtil.actorRouter(primitiva)) match { + case Some(defaultRouter) => + log.debug(s"ROUTER for [$primitiva - DEFAULT] FOUND [${defaultRouter.path}]") + defaultRouter + case None => + log.error(s"ROUTER for [$primitiva] not found") + val dpe = exception.DigitPaException(DigitPaErrorCodes.PPT_SYSTEM_ERROR) + throw dpe + } } soapRequest = SoapRequest( - sessionId, + message.sessionId, message.payload, message.callRemoteAddress.getOrElse(""), primitiva, sender, message.timestamp, - reExtra(message), false, + reExtra(message),false, message.testCaseId ) } yield (router, soapRequest)) map { case (router, soapRequest) => @@ -177,27 +197,27 @@ class SoapActorPerRequest( val now = Util.now() val reRequestResp = ReRequest( - sessionId = sessionId, + sessionId = message.sessionId, testCaseId = message.testCaseId, re = Re( componente = Componente.WISP_SOAP_CONVERTER, categoriaEvento = CategoriaEvento.INTERFACE, sottoTipoEvento = SottoTipoEvento.RESP, esito = Esito.SEND_FAILURE, - sessionId = Some(sessionId), + sessionId = Some(message.sessionId), payload = Some(payload.getUtf8Bytes), insertedTimestamp = now ), - reExtra = Some(ReExtra(callType = Some(CallType.SERVER), statusCode = Some(sre.statusCode), elapsed = Some(message.timestamp.until(now, ChronoUnit.MILLIS)), soapProtocol = true)) + reExtra = Some(ReExtra(callType = Some(CallType.SERVER),statusCode = Some(sre.statusCode), elapsed = Some(message.timestamp.until(now,ChronoUnit.MILLIS)), soapProtocol = true)) ) actorProps.reEventFunc(reRequestResp, log, actorProps.ddataMap) - complete(createHttpResponse(sre.statusCode, payload, sessionId), Constant.KeyName.SOAP_INPUT) + complete(createHttpResponse(sre.statusCode, payload, message.sessionId), Constant.KeyName.SOAP_INPUT) case e: Throwable => log.error(e, "General Error Throwable") - traceRequest(message, actorProps.reEventFunc, actorProps.ddataMap) + traceRequest(message,actorProps.reEventFunc, actorProps.ddataMap) val dpe = exception.DigitPaException(DigitPaErrorCodes.PPT_SYSTEM_ERROR) val payload = Util.faultXmlResponse(dpe.faultCode, dpe.faultString, Some(dpe.message)) @@ -205,49 +225,24 @@ class SoapActorPerRequest( val now = Util.now() val reRequest = ReRequest( - sessionId = sessionId, + sessionId = message.sessionId, testCaseId = message.testCaseId, re = Re( componente = Componente.WISP_SOAP_CONVERTER, categoriaEvento = CategoriaEvento.INTERFACE, sottoTipoEvento = SottoTipoEvento.RESP, esito = Esito.SEND_FAILURE, - sessionId = Some(sessionId), + sessionId = Some(message.sessionId), payload = Some(payload.getUtf8Bytes), insertedTimestamp = now ), - reExtra = Some(ReExtra(callType = Some(CallType.SERVER), statusCode = Some(StatusCodes.InternalServerError.intValue), elapsed = Some(message.timestamp.until(now, ChronoUnit.MILLIS)), soapProtocol = true)) + reExtra = Some(ReExtra(callType = Some(CallType.SERVER),statusCode = Some(StatusCodes.InternalServerError.intValue), elapsed = Some(message.timestamp.until(now,ChronoUnit.MILLIS)), soapProtocol = true)) ) actorProps.reEventFunc(reRequest, log, actorProps.ddataMap) - complete(createHttpResponse(StatusCodes.InternalServerError.intValue, payload, sessionId), Constant.KeyName.SOAP_INPUT) + complete(createHttpResponse(StatusCodes.InternalServerError.intValue, payload, message.sessionId), Constant.KeyName.SOAP_INPUT) } } - def traceRequest(message: SoapRouterRequest, reEventFunc: ReEventFunc, ddataMap: ConfigData): Unit = { - Util.logPayload(log, Some(message.payload)) - val sessionId = MDC.get(Constant.MDCKey.SESSION_ID); - val reRequestReq = ReRequest( - sessionId = sessionId, - testCaseId = message.testCaseId, - re = Re( - componente = Componente.WISP_SOAP_CONVERTER, - categoriaEvento = CategoriaEvento.INTERFACE, - sottoTipoEvento = SottoTipoEvento.REQ, - esito = Esito.RECEIVED, - sessionId = Some(sessionId), - payload = Some(message.payload.getUtf8Bytes), - insertedTimestamp = message.timestamp, - erogatore = Some(FaultId.NODO_DEI_PAGAMENTI_SPC), - erogatoreDescr = Some(FaultId.NODO_DEI_PAGAMENTI_SPC) - ), - reExtra = Some(reExtra(message)) - ) - reEventFunc(reRequestReq, log, ddataMap) - } - - def reExtra(message: SoapRouterRequest): ReExtra = - ReExtra(callType = Some(CallType.SERVER), uri = message.uri, headers = message.headers.getOrElse(Nil), httpMethod = Some(HttpMethods.POST.toString()), callRemoteAddress = message.callRemoteAddress, soapProtocol = true) - private def extractSender(xml: NodeSeq, path: String): Try[String] = { path.split("/").foldLeft[Try[NodeSeq]](Try(xml))((nodeOption, element) => nodeOption.flatMap(node => Try(node \ element))).flatMap(resultNode => Try(resultNode.head.text)) } From 1d0262c803caa5ef412abaedc6569ed9a11eded0 Mon Sep 17 00:00:00 2001 From: Andrea De Rinaldis Date: Wed, 3 Jul 2024 09:52:21 +0200 Subject: [PATCH 6/8] [PAGOPA-1894] fix: rollbacked changes, forced set sessionId from MDC --- .../it/gov/pagopa/actors/NodoInviaCarrelloRPTActor.scala | 7 +++++-- .../scala/it/gov/pagopa/actors/NodoInviaRPTActor.scala | 8 ++++++-- .../src/main/scala/it/gov/pagopa/common/message/Re.scala | 1 - .../src/main/scala/it/gov/pagopa/common/util/ReUtil.scala | 5 ++++- .../pagopa/common/util/azure/cosmos/CosmosBuilder.scala | 4 ++-- .../pagopa/common/util/azure/cosmos/ReEventEntity.scala | 3 --- 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaCarrelloRPTActor.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaCarrelloRPTActor.scala index 21b9b279..89f9a97e 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaCarrelloRPTActor.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaCarrelloRPTActor.scala @@ -89,12 +89,14 @@ case class NodoInviaCarrelloRPTActorPerRequest(cosmosRepository: CosmosRepositor req = soapRequest replyTo = sender() + // parachute session id, will be replaced lately when the sessionId will be generated + MDC.put(Constant.MDCKey.SESSION_ID, req.sessionId) + re = Some( Re( componente = Componente.WISP_SOAP_CONVERTER, categoriaEvento = CategoriaEvento.INTERNAL, sessionId = None, - sessionIdUuid = Some(req.sessionId), sessionIdOriginal = Some(req.sessionId), payload = None, esito = Esito.EXCECUTED_INTERNAL_STEP, @@ -117,9 +119,10 @@ case class NodoInviaCarrelloRPTActorPerRequest(cosmosRepository: CosmosRepositor _ = log.debug("Check sintattici input") (intestazioneCarrelloPPT, nodoInviaCarrelloRPT) <- Future.fromTry(parseCarrello(soapRequest.payload, inputXsdValid)) _ = idCarrello = intestazioneCarrelloPPT.identificativoCarrello + _ = MDC.put(Constant.MDCKey.SESSION_ID, RPTUtil.getUniqueKey(req, intestazioneCarrelloPPT)) _ = re = re.map(r => r.copy( - sessionId = Some(RPTUtil.getUniqueKey(req, intestazioneCarrelloPPT)), + sessionId = Some(MDC.get(Constant.MDCKey.SESSION_ID)), idCarrello = Some(idCarrello), psp = Some(nodoInviaCarrelloRPT.identificativoPSP), canale = Some(nodoInviaCarrelloRPT.identificativoCanale), diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaRPTActor.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaRPTActor.scala index c8708390..12ec5a7f 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaRPTActor.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/actors/NodoInviaRPTActor.scala @@ -88,12 +88,15 @@ case class NodoInviaRPTActorPerRequest(cosmosRepository: CosmosRepository, actor case soapRequest: SoapRequest => req = soapRequest replyTo = sender() + + // parachute session id, will be replaced lately when the sessionId will be generated + MDC.put(Constant.MDCKey.SESSION_ID, req.sessionId) + re = Some( Re( componente = Componente.WISP_SOAP_CONVERTER, categoriaEvento = CategoriaEvento.INTERNAL, sessionId = None, - sessionIdUuid = Some(req.sessionId), sessionIdOriginal = Some(req.sessionId), payload = None, esito = Esito.EXCECUTED_INTERNAL_STEP, @@ -117,6 +120,7 @@ case class NodoInviaRPTActorPerRequest(cosmosRepository: CosmosRepository, actor _ = log.debug("Input parserizzato correttamente") _ = rptKey = RPTKey(intestazionePPT.identificativoDominio, intestazionePPT.identificativoUnivocoVersamento, intestazionePPT.codiceContestoPagamento) + _ = MDC.put(Constant.MDCKey.SESSION_ID, RPTUtil.getUniqueKey(req, intestazionePPT)); _ = MDC.put(Constant.MDCKey.ID_DOMINIO, rptKey.idDominio) _ = MDC.put(Constant.MDCKey.IUV, rptKey.iuv) _ = MDC.put(Constant.MDCKey.CCP, rptKey.ccp) @@ -126,7 +130,7 @@ case class NodoInviaRPTActorPerRequest(cosmosRepository: CosmosRepository, actor _ = re = re.map(r => r.copy( - sessionId = Some(RPTUtil.getUniqueKey(req, intestazionePPT)), + sessionId = Some(MDC.get(Constant.MDCKey.SESSION_ID)), psp = Some(nodoInviaRPT.identificativoPSP), canale = Some(nodoInviaRPT.identificativoCanale), fruitore = Some(intestazionePPT.identificativoStazioneIntermediarioPA), diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/message/Re.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/message/Re.scala index 7fa81f5c..f7666a0f 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/message/Re.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/message/Re.scala @@ -25,7 +25,6 @@ case class Re( parametriSpecificiInterfaccia: Option[String] = None, esito: Esito.Value, sessionId: Option[String] = None, - sessionIdUuid: Option[String] = None, status: Option[String] = None, payload: Option[Array[Byte]] = None, info: Option[String] = None, diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/ReUtil.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/ReUtil.scala index b63cd16b..fa27ebf5 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/ReUtil.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/ReUtil.scala @@ -5,8 +5,10 @@ import it.gov.pagopa.common.message._ import it.gov.pagopa.common.util.ConfigUtil.ConfigData import it.gov.pagopa.common.util.azure.Appfunction.ReEventFunc import it.gov.pagopa.common.util.azure.cosmos.{CategoriaEvento, Esito, SottoTipoEvento} +import org.slf4j.MDC -trait ReUtil { this: NodoLogging => +trait ReUtil { + this: NodoLogging => def traceInterfaceRequest(message: SoapRequest, re: Re, reExtra: ReExtra, reEventFunc: ReEventFunc, ddataMap: ConfigData): Unit = { import StringUtils.Utf8String @@ -15,6 +17,7 @@ trait ReUtil { this: NodoLogging => sessionId = message.sessionId, testCaseId = message.testCaseId, re = re.copy( + sessionId = Some(MDC.get(Constant.MDCKey.SESSION_ID)), insertedTimestamp = message.timestamp, payload = Some(message.payload.getUtf8Bytes), categoriaEvento = CategoriaEvento.INTERFACE, diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/CosmosBuilder.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/CosmosBuilder.scala index 3ad4dc8d..5ed1fc1b 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/CosmosBuilder.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/CosmosBuilder.scala @@ -9,6 +9,7 @@ import it.gov.pagopa.common.util.ConfigUtil.ConfigData import it.gov.pagopa.common.util._ import it.gov.pagopa.common.util.azure.Appfunction import it.gov.pagopa.common.util.azure.Appfunction.{ReEventFunc, defaultOperation} +import org.slf4j.MDC import java.io.ByteArrayOutputStream import java.util.Base64 @@ -88,8 +89,7 @@ case class CosmosBuilder() { fault.flatMap(_._2).orNull, fault.flatMap(_._3).orNull, request.re.tipoEvento.orNull, - request.re.sessionId.orNull, - request.re.sessionIdOriginal.orNull, + MDC.get(Constant.MDCKey.SESSION_ID), request.re.idCarrello.orNull, request.re.iuv.orNull, request.re.noticeNumber.orNull, diff --git a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/ReEventEntity.scala b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/ReEventEntity.scala index 4a58fdde..1b82e333 100644 --- a/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/ReEventEntity.scala +++ b/wispsoapconverter/src/main/scala/it/gov/pagopa/common/util/azure/cosmos/ReEventEntity.scala @@ -58,7 +58,6 @@ case class ReEventEntity( operationErrorCode: String, primitive: String, sessionId: String, - sessionIdUuid: String, cartId: String, iuv: String, noticeNumber: String, @@ -122,8 +121,6 @@ case class ReEventEntity( def getSessionId: String = sessionId - def getSessionIdUuid: String = sessionIdUuid - def getCartId: String = cartId def getIuv: String = iuv From bfe853cd6261ca15db1c81c9de3443bf05389e8a Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Wed, 3 Jul 2024 07:53:18 +0000 Subject: [PATCH 7/8] Bump to version 0.2.6-84-PAGOPA-1894-fix-sessionId [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 +- version.sbt | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 72d896c0..4980f091 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: wisp-soap-converter-chart description: Wisp Soap Conveter type: application -version: 2.40.0 -appVersion: 0.2.6-82-PAGOPA-1894-fix-sessionId +version: 2.41.0 +appVersion: 0.2.6-84-PAGOPA-1894-fix-sessionId dependencies: - name: microservice-chart version: 3.0.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 01262347..266cc055 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -2,7 +2,7 @@ microservice-chart: µservice-chart namespace: "nodo" image: repository: ghcr.io/pagopa/pagopa-wisp-soap-converter - tag: 0.2.6-82-PAGOPA-1894-fix-sessionId + tag: 0.2.6-84-PAGOPA-1894-fix-sessionId canaryDelivery: create: false wispsoapconverter: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 9a0afd6c..7d24c35a 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -2,7 +2,7 @@ microservice-chart: µservice-chart namespace: "nodo" image: repository: ghcr.io/pagopa/pagopa-wisp-soap-converter - tag: 0.2.6-82-PAGOPA-1894-fix-sessionId + tag: 0.2.6-84-PAGOPA-1894-fix-sessionId canaryDelivery: create: false wispsoapconverter: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index ebd72a7b..eea79187 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -2,7 +2,7 @@ microservice-chart: µservice-chart namespace: "nodo" image: repository: ghcr.io/pagopa/pagopa-wisp-soap-converter - tag: 0.2.6-82-PAGOPA-1894-fix-sessionId + tag: 0.2.6-84-PAGOPA-1894-fix-sessionId canaryDelivery: create: false wispsoapconverter: diff --git a/openapi/openapi.json b/openapi/openapi.json index c51558f8..e140264b 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "title": "Wisp soap converter", "description": "Wisp soap converter", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.2.6-82-PAGOPA-1894-fix-sessionId" + "version": "0.2.6-84-PAGOPA-1894-fix-sessionId" }, "servers": [ { diff --git a/version.sbt b/version.sbt index b72dfa30..886a6a96 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -ThisBuild / version := "0.2.6-82-PAGOPA-1894-fix-sessionId" +ThisBuild / version := "0.2.6-84-PAGOPA-1894-fix-sessionId" From d74dfb57bd1af6af69a51add3e7baffc8f031682 Mon Sep 17 00:00:00 2001 From: pagopa-github-bot Date: Wed, 3 Jul 2024 08:25:59 +0000 Subject: [PATCH 8/8] Bump to version 0.2.7-87-PAGOPA-1894-fix-sessionId [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 +- version.sbt | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 073cabb8..95c88198 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: wisp-soap-converter-chart description: Wisp Soap Conveter type: application -version: 2.41.0 -appVersion: 0.2.7 +version: 2.42.0 +appVersion: 0.2.7-87-PAGOPA-1894-fix-sessionId dependencies: - name: microservice-chart version: 3.0.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index cb6b950c..1abd6002 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -2,7 +2,7 @@ microservice-chart: µservice-chart namespace: "nodo" image: repository: ghcr.io/pagopa/pagopa-wisp-soap-converter - tag: 0.2.7 + tag: 0.2.7-87-PAGOPA-1894-fix-sessionId canaryDelivery: create: false wispsoapconverter: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 57718fe6..1e1df9ca 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -2,7 +2,7 @@ microservice-chart: µservice-chart namespace: "nodo" image: repository: ghcr.io/pagopa/pagopa-wisp-soap-converter - tag: 0.2.7 + tag: 0.2.7-87-PAGOPA-1894-fix-sessionId canaryDelivery: create: false wispsoapconverter: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 961224b0..c1cf672a 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -2,7 +2,7 @@ microservice-chart: µservice-chart namespace: "nodo" image: repository: ghcr.io/pagopa/pagopa-wisp-soap-converter - tag: 0.2.7 + tag: 0.2.7-87-PAGOPA-1894-fix-sessionId canaryDelivery: create: false wispsoapconverter: diff --git a/openapi/openapi.json b/openapi/openapi.json index 5f3d06f6..23e579e8 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "title": "Wisp soap converter", "description": "Wisp soap converter", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.2.7" + "version": "0.2.7-87-PAGOPA-1894-fix-sessionId" }, "servers": [ { diff --git a/version.sbt b/version.sbt index 5d3a24f9..a5dc5d00 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -ThisBuild / version := "0.2.7" +ThisBuild / version := "0.2.7-87-PAGOPA-1894-fix-sessionId"