Persistence
Bases de datos compatibles
Actualmente, ipf-ods solo es compatible con MongoDB, pero también puede funcionar con Azure Cosmos DB ya que implementa el protocolo de red de MongoDB.
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 tipos PDS definidos por IPF y específicos del cliente |
|
Datos relacionados con el procesamiento de un pago. Estos documentos tienen un objectType para indicar el tipo de datos de procesamiento, 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 bruto de las otras colecciones. |
|
Metadatos para un |
|
Entrada diaria que documenta los detalles de una ejecución de purge. Creada durante ODS-Purging |
|
Entrada diaria que documenta el número de |
|
Rastrea el estado de selección de candidatos para archivado. Creado durante Candidate Selection |
Indexación
De forma predeterminada, las aplicaciones ingestion e inquiry intentarán crear todos los índices necesarios al inicio. Para desactivar este comportamiento y crear los índices manualmente, proporcione la siguiente configuración:
ods.persistence.indexing.enabled = false
Aunque los protocolos de red son iguales, las implementaciones del motor de base de datos subyacente difieren entre MongoDB y CosmosDB, lo que impacta las opciones de indexación. Por ello, las aplicaciones ODS crearán un conjunto diferente de índices dependiendo de a qué base de datos hablen, siendo el modo de creación de índices para MongoDB 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 |
|---|---|
|
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 |
|---|---|
|
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 |
|
Highly selective, there will exist a small number (depending on implementation, tens to low hundreds) of process flow events for an entityId. Only applicable to process flow event process objects |
| Index definition | Comments |
|---|---|
|
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 |
|
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 |
|---|---|
|
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 |
|---|---|
|
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. |
|
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. |
|
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 |
|---|---|
|
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 |
|
Very low selectivity, there will be a large number of documents for any given 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 |
|
Highly selective, there will exist a small number (depending on implementation, tens to low hundreds) of process flow events for an entityId. Only applicable to process flow event process objects |
| Index definition | Comments |
|---|---|
|
Latest PDS object search does a descending sort on sequenceNumber |
| Index definition | Comments |
|---|---|
|
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. |
|
Very low selectivity, there will be a large number of 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. |
| Index definition | Comments |
|---|---|
|
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 |
|
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) |
Akka Jackson Serialization
Dentro del módulo ods-ingestion-core, SummaryHandler utiliza akka-jackson-serialization para manejar la serialización y deserialización de mensajes pasados entre actores que se ejecutan en diferentes hosts.
Las clases que implementan la interfaz SummaryCommand extends CborSerializable están marcadas como clases que deben serializarse/deserializarse a través de akka-jackson-serialization.
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public interface SummaryCommand extends CborSerializable {
}
En la configuración siguiente, la interfaz compartida de IPF CborSerializable se vincula al serializador jackson-json predeterminado; por lo tanto, todo lo que implemente esta interfaz también se vincula 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
}
}
}
}
Personalizaciones
El ajuste de configuración: deserialization-features.ADJUST_DATES_TO_CONTEXT_TIME_ZONE se anula para que las dateTimes con un desplazamiento (p. ej., OffsetDateTime, ZonedDateTime…) no se ajusten a UTC cuando los mensajes se deserializan entre instancias del actor SummaryHandler. Puede encontrar más información en la documentación de Jackson.
La anotación @JsonInclude(JsonInclude.Include.NON_EMPTY) aplicada a SummaryCommand se utiliza para excluir valores vacíos o nulos de la serialización y deserialización. Puede encontrar más información en la documentación de Jackson.