Persistencia
Bases de datos soportadas
Actualmente, ipf-ods solo admite MongoDB, pero también puede funcionar con Azure Cosmos DB ya que implementa MongoDB protocolo de conexión.
CosmosDB
ipf.mongodb.url = "<<cosmos-db-url>>"
//You may need this
spring.data.mongodb.database = "ipf"
//Or even the full url
spring.data.mongodb.uri = "<<cosmos-db-url>>"
Ejemplo de URL de Cosmos DB
mongodb://ipfcosmosdbdemo:vooQt7iRpI0WyUVC5IIKbq7RT058xJCKdtnjdbOhFnQK2QDLiaWeCrN2TDIEzeBLwLFTEHT47iSSKUowEtrmWw==@ipfcosmosdbdemo.mongo.cosmos.azure.com:10255/ipf?ssl=true&replicaSet=globaldb&retrywrites=false&maxIdleTimeMS=120000&appName=@ipfcosmosdbdemo@
Colecciones
| Nombre | Descripción |
|---|---|
|
Contiene objetos de pago ISO 20022. |
|
Contiene IPF definido y específico para el cliente,PDS tipos |
|
Datos relacionados con el procesamiento de un pago. Estos documentos tienen un objectType para indicar el tipo de processing data, como |
|
Datos específicos del cliente relacionados con un pago. |
|
Tipo de alto nivel que representa un pago, construido a partir de los datos en las otras colecciones. |
|
Meta-datos para un dado unitOfWorkId, construido a partir de ingerido process flow events. |
|
Una entrada diaria documentando los detalles de la ejecución de una purga. Creada durante ODS-Purging |
|
Una entrada diaria que documenta el número de unitOfWorks que deben expirar en n días. |
|
Rastrea la selección de candidatos para el archivo.state. Creado durante Selección de Candidatos |
Indexación
Por defecto, las aplicaciones de ingestión e indagación intentarán crear todos los índices requeridos al iniciar. Para deshabilitar este comportamiento y crear los índices manualmente, proporcione la siguiente configuración:
ods.persistence.indexing.enabled = false
Aunque los protocolos de conexión son los mismos, las implementaciones del motor de base de datos subyacente difieren para MongoDB y bases de datos CosmosDB, lo que afecta las opciones de indexación. ODS las aplicaciones, por lo tanto, estarán creando un conjunto diferente de índices dependiendo de a qué base de datos se estén refiriendo, con MongoDB el modo de creación de índices siendo el predeterminado. Para cambiar el modo a CosmosDB, proporcione la siguiente configuración:
ods.persistence.indexing.mode = cosmosdb
Indexes declared by the ODS Ingestion App
Indexes declared in MongoDB mode
| Index definition | Comments |
|---|---|
|
A single report exists per day, and is retrieved by the executionDate |
| Index definition | Comments |
|---|---|
|
Used in upserts in order to de-duplicate process objects as they’re ingested. |
| Index definition | Comments |
|---|---|
|
Summaries are uniquely identified by unitOfWorkIds. |
|
Updated each time a summary changes. |
|
Set and updated for Batch Summaries AND Payment Summaries that contain a relatedUnitOfWorkId Used for Payment Summary enrichment of identification fields from the related Batch Summary High selectivity as this is set as a UUID |
| Index definition | Comments |
|---|---|
|
Used in upserts in order to de-duplicate MDS objects as they’re ingested. |
| Index definition | Comments |
|---|---|
|
Used in upserts in order to de-duplicate custom objects as they’re ingested. |
| Index definition | Comments |
|---|---|
|
PDS objects are retrieved by unitOfWorkId directly |
|
Each PDS object version is stored as a single document, where sequenceNumber identifies its version. |
| Index definition | Comments |
|---|---|
|
UnitOfWorks are uniquely identified by unitOfWorkIds. Used in upserts in order to de-duplicate UnitOfWork objects as they’re ingested. |
|
UnitOfWorks startedAt is used to determine candidates for purging. |
|
UnitOfWorks are eligible and retrieved for archiving by the finishedAt field. UnitOfWorks finishedAt is used to determine candidates for purging. |
|
UnitOfWorks archivedAt is used to determine candidates for purging. |
|
Archiving can be configured to only delete unit of works with a defined journey type |
Indexes declared in CosmosDB mode
| Index definition | Comments |
|---|---|
|
A single report exists per day, and is retrieved by the executionDate |
| Index definition | Comments |
|---|---|
|
Used in upserts in order to de-duplicate process objects as they’re ingested. |
| Index definition | Comments |
|---|---|
|
A single report exists per day, and is retrieved by the expiryDate |
| Index definition | Comments |
|---|---|
|
Summaries are uniquely identified by unitOfWorkIds. |
|
Updated each time a summary changes, and used to determine candidates for purging |
|
Set and updated for Batch Summaries AND Payment Summaries that contain a relatedUnitOfWorkId Used for Payment Summary enrichment of identification fields from the related Batch Summary High selectivity as this is set as a UUID |
| Index definition | Comments |
|---|---|
|
Used in upserts in order to de-duplicate MDS objects as they’re ingested. |
| Index definition | Comments |
|---|---|
|
Used in upserts in order to de-duplicate custom objects as they’re ingested. |
| Index definition | Comments |
|---|---|
|
PDS objects are retrieved by unitOfWorkId directly |
|
Each PDS object version is stored as a single document, where sequenceNumber identifies its version. |
| Index definition | Comments |
|---|---|
|
UnitOfWorks are uniquely identified by unitOfWorkIds. Used in upserts in order to de-duplicate UnitOfWork objects as they’re ingested. |
|
UnitOfWorks startedAt is used to determine candidates for purging. |
|
UnitOfWorks are eligible and retrieved for archiving by the finishedAt field. UnitOfWorks finishedAt is used to determine candidates for purging. |
|
UnitOfWorks archivedAt is used to determine candidates for purging. |
|
Archiving can be configured to only delete unit of works with a defined journey type |
Indexes declared by the ODS Inquiry App
Indexes declared in MongoDB mode
| Index definition | Comments |
|---|---|
|
Very low selectivity, there will be a large number of documents for any given value. |
|
Highly selective, we would expect only a few documents for any given value. |
|
Likely unique and therefore highly selective, we would expect only a single document for any given value. |
|
Highly selective, we would expect only a few documents for any given value. |
|
Highly selective, we would expect only a few documents for any given value. |
|
Will be used in ranged queries, where the upper or lower bound could be missing. If both bounds are present the selectivity could be very high for small enough ranges. If the range is large, or a bound is missing then the selectivity could be very low. |
| Index definition | Comments |
|---|---|
|
Has low selectivity, we can expect a large number of summaries with the same value. |
|
Likely unique and therefore highly selective, we would expect only a single document for any given value. May eventually be removed since the clientRequestId is also present in the alternativeIds.value index |
|
Links a summary, to the parent/related summary. Many summaries could link to the same "parent" summary, e.g. many batches link to a single bulk, or many payments link to a single batch which means a summary can have [0..1] parents, and [0..n] children. |
|
Values should be highly selective, if there’s any duplication, results should be small enough to be sorted in-memory |
|
Will be used in ranged queries, where the upper or lower bound could be missing. If both bounds are present the selectivity could be very high for small enough ranges. If the range is large, or a bound is missing then the selectivity could be very low. |
|
Likely unique and therefore highly selective, we would expect a single summary for a given value |
|
chargeAmount will be used in ranged queries, where the upper or lower bound could be missing. If both bounds are present the selectivity could be very high for small enough ranges. If the range is large, or a bound is missing then the selectivity could be very low. |
|
chargeAmountCurrency has low selectivity, we can expect a large number of summaries with the same currency |
|
Likely unique and therefore highly selective, we would expect a single summary for a given value |
|
Likely unique and therefore highly selective, we would expect a single summary for a given value |
|
Likely unique and therefore highly selective, we would expect a single summary for a given value |
|
Likely unique and therefore highly selective, we would expect a single summary for a given value |
|
Likely unique and therefore highly selective, we would expect a single summary for a given value |
|
Likely unique and therefore highly selective, we would expect a single summary for a given value |
|
Likely unique and therefore highly selective, we would expect a single summary for a given value |
|
Likely unique and therefore highly selective, we would expect a single summary for a given value |
|
Will usually have a high selectivity (small number of payments for a single account for example) but in some cases (bulk) accounts may have a very large number of outgoing payments and therefore selectivity will be lower |
|
Would likely have low selectivity, for example many outgoing payments will have the same bic value |
|
Probably highly selective, but in some cases it may have low selectivity (bulk?) |
|
Will usually have a high selectivity (small number of payments for a single account for example) but in some cases (bulk) accounts may have a very large number of outgoing payments and therefore selectivity will be lower |
|
Would likely have low selectivity, for example many incoming payments will have the same bic value |
|
Probably highly selective, but in some cases it may have low selectivity (bulk?) |
|
For outbound recalls, this represents the client bank, for inbound recalls, this represents the other bank Selectivity is probably on the low-end |
|
For outbound recalls, this represents the other bank, for inbound recalls, this represents the client bank Selectivity is probably on the low-end |
|
Selectivity is probably on the low-end |
|
Selectivity is probably on the low-end |
|
Selectivity is probably on the low-end |
|
Will usually have a high selectivity (small number of payments for a single account for example) but in some cases (bulk) accounts may have a very large number of outgoing payments and therefore selectivity will be lower |
|
Will usually have a high selectivity (small number of payments for a single account for example) but in some cases (bulk) accounts may have a very large number of outgoing payments and therefore selectivity will be lower |
|
Will be used in ranged queries, where the upper or lower bound could be missing. If both bounds are present the selectivity could be very high for small enough ranges. If the range is large, or a bound is missing then the selectivity could be very low. |
|
Will be used in ranged queries, where the upper or lower bound could be missing. If both bounds are present the selectivity could be very high for small enough ranges. If the range is large, or a bound is missing then the selectivity could be very low. |
|
Will be used in ranged queries, where the upper or lower bound could be missing. If both bounds are present the selectivity could be very high for small enough ranges. If the range is large, or a bound is missing then the selectivity could be very low. |
|
Selectivity of a single field index for csm would probably be on the low-end |
| Index definition | Comments |
|---|---|
|
Very low selectivity, there will be a large number of documents for any given value. |
|
Unique per unitOfWorkId and possibly also unique globally so offers high selectivity. Applicable to all process object types |
|
High selectivity - depending on the implementation, should identify double to triple digit objects. Applicable to all process object types |
|
High selectivity, similar to unitOfWorkId - will usually hold either a unitOfWorkId or a flow ID. Applicable to all process object types |
|
Likely unique and therefore highly selective, in most cases we would expect only a few objects for a given value. There will, however, be many process objects with the value 'UNKNOWN' which can give low selectivity if this is used as a search value. Applicable to all process object types |
|
Will be used in ranged queries, where the upper or lower bound could be missing. If both bounds are present the selectivity could be very high for small enough ranges. If the range is large, or a bound is missing then the selectivity could be very low. Applicable to all process object types |
|
Very low selectivity, there will be a large number of documents for any given value. |
| Index definition | Comments |
|---|---|
|
Unique per unit of work only, e.g., there will be 1+ pds objects with the same pdsObjectId per unitOfWorkId |
|
Latest PDS object search does a descending sort on sequenceNumber |
| Index definition | Comments |
|---|---|
|
Very low selectivity, there will be a large number of documents for any given value. |
|
Likely unique and therefore highly selective, we would expect only a single document for any given value. |
|
For instant payments, likely to be highly selective, we would expect only a few documents for a given value. For bulk payments there could be tens of thousands of documents for some values.. |
|
For instant payments, likely to be highly selective, we would expect only a few documents for a given value. For bulk payments there could be tens of thousands of documents for some values.. |
|
Highly selective, we would expect only a few documents for any given value. |
|
Highly selective, we would expect only a few documents for any given value. |
|
Will be used in ranged queries, where the upper or lower bound could be missing. If both bounds are present the selectivity could be very high for small enough ranges. If the range is large, or a bound is missing then the selectivity could be very low. |
|
For instant payments, likely unique and therefore highly selective, we would expect only a single document for any given value. For bulk payments there could be tens of thousands of documents for a single instruction. |
|
Highly selective, we would expect only a few documents for any given value. |
|
For instant payments, likely unique and therefore highly selective, we would expect only a single document for any given value. For bulk payments there could be tens of thousands of documents for a single instruction. |
|
Likely unique and therefore highly selective, we would expect only a single document for any given value. |
|
Likely unique and therefore highly selective, we would expect only a single document for any given value. |
|
Likely unique and therefore highly selective, we would expect only a single document for any given value. |
|
Likely unique and therefore highly selective, we would expect only a single document for any given value. |
|
Likely unique and therefore highly selective, we would expect only a single document for any given value. |
|
Likely unique and therefore highly selective, we would expect only a single document for any given value. |
|
Likely unique and therefore highly selective, we would expect only a single document for any given value. |
|
Likely unique and therefore highly selective, we would expect only a single document for any given value. |
|
Likely unique and therefore highly selective, we would expect only a single document for any given value. |
|
For instant payments, probably highly selective, we would expect only a few documents for any given value. For bulk payments there could be tens of thousands of documents for a single instruction. Field value will be lower case, and searches will be a starts with regex. |
|
For instant payments, probably highly selective, we would expect only a few documents for any given value. For bulk payments there could be tens of thousands of documents for a single instruction. Field value will be lower case, and searches will be a starts with regex. |
|
For instant payments, probably highly selective, we would expect only a few documents for any given value. For bulk payments there could be tens of thousands of documents for a single instruction. Field value will be lower case, and searches will be a starts with regex. |
|
For instant payments, probably highly selective, we would expect only a few documents for any given value. For bulk payments there could be tens of thousands of documents for a single instruction. Field value will be lower case, and searches will be a starts with regex. |
|
For instant payments, probably highly selective, we would expect only a few documents for any given value. For bulk payments there could be tens of thousands of documents for a single instruction. Field value will be lower case, and searches will be a starts with regex. |
|
For instant payments, probably highly selective, we would expect only a few documents for any given value. For bulk payments there could be tens of thousands of documents for a single instruction. Field value will be lower case, and searches will be a starts with regex. |
|
For instant payments, probably highly selective, we would expect only a few documents for any given value. For bulk payments there could be tens of thousands of documents for a single instruction. Field value will be lower case, and searches will be a starts with regex. |
|
For instant payments, probably highly selective, we would expect only a few documents for any given value. For bulk payments there could be tens of thousands of documents for a single instruction. Field value will be lower case, and searches will be a starts with regex. |
|
For instant payments, probably highly selective, we would expect only a few documents for any given value. For bulk payments there could be tens of thousands of documents for a single instruction. Field value will be lower case, and searches will be a starts with regex. |
|
For instant payments, probably highly selective, we would expect only a few documents for any given value. For bulk payments there could be tens of thousands of documents for a single instruction. Field value will be lower case, and searches will be a starts with regex. |
Indexes declared in CosmosDB mode
| Index definition | Comments |
|---|---|
|
Very low selectivity, there will be a large number of documents for any given value. |
|
Highly selective, we would expect only a few documents for any given value. |
|
Likely unique and therefore highly selective, we would expect only a single document for any given value. |
|
Highly selective, we would expect only a few documents for any given value. |
|
Highly selective, we would expect only a few documents for any given value. |
|
Will be used in ranged queries, where the upper or lower bound could be missing. If both bounds are present the selectivity could be very high for small enough ranges. If the range is large, or a bound is missing then the selectivity could be very low. |
|
Very low selectivity, there will be a large number of documents for any given value. |
| Index definition | Comments |
|---|---|
|
Very low selectivity, there will be a large number of documents for any given value. |
|
Unique per unitOfWorkId and possibly also unique globally so offers high selectivity. Applicable to all process object types |
|
High selectivity - depending on the implementation, should identify double to triple digit objects. Applicable to all process object types |
|
High selectivity, similar to unitOfWorkId - will usually hold either a unitOfWorkId or a flow ID. Applicable to all process object types |
|
Likely unique and therefore highly selective, in most cases we would expect only a few objects for a given value. There will, however, be many process objects with the value 'UNKNOWN' which can give low selectivity if this is used as a search value. Applicable to all process object types |
|
Will be used in ranged queries, where the upper or lower bound could be missing. If both bounds are present the selectivity could be very high for small enough ranges. If the range is large, or a bound is missing then the selectivity could be very low. Applicable to all process object types |
|
Has low selectivity, we can expect a large number of documents with the same value. Applicable to all process object types |
|
Has low selectivity, we can expect a large number of documents with the same value. Applicable to all process object types |
|
Has low selectivity, we can expect a large number of documents with the same value. Only applicable to message log process objects |
|
Has low selectivity, we can expect a large number of documents with the same value. Only applicable to system event process objects |
|
Has low selectivity, we can expect a large number of documents with the same value. Only applicable to system event process objects |
|
Has low selectivity, we can expect a large number of documents with the same value. Only applicable to system event process objects |
| Index definition | Comments |
|---|---|
|
Very low selectivity, there will be a large number of documents for any given value. |
|
Likely unique and therefore highly selective, we would expect a single summary for a clientRequestId. May eventually be removed since the clientRequestId is also present in the alternativeIds.value index |
|
Links a summary, to the parent/related summary. Many summaries could link to the same "parent" summary, e.g. many batches link to a single bulk, or many payments link to a single batch which means a summary can have [0..1] parents, and [0..n] children. |
|
Values should be highly selective, if there’s any duplication, results should be small enough to be sorted in-memory |
|
Will be used in ranged queries, where the upper or lower bound could be missing. If both bounds are present the selectivity could be very high for small enough ranges. If the range is large, or a bound is missing then the selectivity could be very low. |
|
Has low selectivity, we can expect a large number of summaries with the same value. |
|
Has low selectivity, we can expect a large number of summaries with the same value. |
|
Has low selectivity, we can expect a large number of summaries with the same value. |
|
totalAmount will be used in ranged queries, where the upper or lower bound could be missing. If both bounds are present the selectivity could be very high for small enough ranges. If the range is large, or a bound is missing then the selectivity could be very low. |
|
totalAmountCurrency has low selectivity, we can expect a large number of summaries with the same currency |
|
chargeAmount will be used in ranged queries, where the upper or lower bound could be missing. If both bounds are present the selectivity could be very high for small enough ranges. If the range is large, or a bound is missing then the selectivity could be very low. |
|
chargeAmountCurrency has low selectivity, we can expect a large number of summaries with the same currency |
|
CosmosDB’s unique way of indexing all the fields within document; will be a mix of high (uetr, ID fields, accounts numbers, creditor/debtor names etc) and low selectivity fields (reason codes, amounts, currency, BICs) |
| Index definition | Comments |
|---|---|
|
Unique per unit of work only, e.g., there will be 1+ pds objects with the same pdsObjectId per unitOfWorkId |
|
Latest PDS object search does a descending sort on sequenceNumber |
| Index definition | Comments |
|---|---|
|
Very low selectivity, there will be a large number of documents for any given value. |
|
Likely unique and therefore highly selective, we would expect only a single document for any given value. |
|
For instant payments, likely to be highly selective, we would expect only a few documents for a given value. For bulk payments there could be tens of thousands of documents for some values.. |
|
For instant payments, likely to be highly selective, we would expect only a few documents for a given value. For bulk payments there could be tens of thousands of documents for some values.. |
|
Highly selective, we would expect only a few documents for any given value. |
|
Highly selective, we would expect only a few documents for any given value. |
|
Usually very low selectivity, there will be a large number of documents for most lookups. High selectivity for rare ISO types like R-messages. |
|
Will be used in ranged queries, where the upper or lower bound could be missing. If both bounds are present the selectivity could be very high for small enough ranges. If the range is large, or a bound is missing then the selectivity could be very low. |
|
Latest payment object search does a descending sort on sequenceNumber |
|
CosmosDB’s unique way of indexing all the fields within document; will be a mix of high (uetr, ID fields, accounts numbers, creditor/debtor names etc) and low selectivity fields (reason codes, amounts, currency, BICs). Some ID fields may offer medium to low selectivity for bulk payments where a single instruction may create tens of thousands of payment objects. |
Akka Jackson Serialización
Dentro de la ods-ingestión-core módulo,SummaryHandler utiliza akka-jackson-serialización para manejar la serialización y deserialización de mensajes transmitidos entre actores que se ejecutan en diferentes hosts.
Clases que implementan SummaryCommand extends CborSerializable las interfaces se marcan como clases que deben ser serializadas/deserializadas a través de akka-jackson-serialización.
@JsonInclude(JsonInclude. Include. NON_EMPTY)
public interface SummaryCommand extends CborSerializable {
}
En la configuración a continuación, el ipf compartido CborSerializable la interfaz está vinculada al predeterminado jackson-json el serializador, por lo tanto, cualquier cosa que implemente esta Interfaz también está sujeta a este serializador.
akka {
actor {
provider = cluster
serialization-bindings {
"com.iconsolutions.ipf.core.shared.domain. CborSerializable" = jackson-json
}
}
serialization.jackson {
jackson-json {
deserialization-features {
ADJUST_DATES_TO_CONTEXT_TIME_ZONE = off
}
}
}
}
Customizations
La configuración:`deserialization-features. ADJUST_DATES_TO_CONTEXT_TIME_ZONE` se anula para que las fechas y horas proporcionadas con un desplazamiento (por ejemplo, OffsetDateTime, ZonedDateTime..) no se ajusten a UTC cuando los mensajes se deserializan entre instancias del actor SummaryHandler. Puede encontrar más información en el link:https://fasterxml.github.io/jackson-annotations/javadoc/2. 8/com/fasterxml/jackson/annotation/JsonFormat. Feature.html#ADJUST_DATES_TO_CONTEXT_TIME_ZONE[Jackson docs].
El @JsonInclude(JsonInclude. Include. NON_EMPTY) anotación aplicada a SummaryCommand se utiliza para excluir valores que están vacíos o nulos de ser serializados y deserializados. Puede encontrar más información en el link:https://fasterxml.github.io/jackson-annotations/javadoc/2. 7/com/fasterxml/jackson/annotation/JsonInclude. Include.html#NON_EMPTY[Jackson docs].