Almacenamiento de Información de Ejecución

El Ejecutor de Entradas de Pago realiza un seguimiento del progreso de la Instrucción de Pago que se está procesando. Esto proporciona observabilidad y, más importante aún, un punto de reanudación en caso de errores inesperados.

Información de Ejecución

La entidad de dominio que contiene la información sobre el procesamiento de la instrucción específica se define de la siguiente manera:

package com.iconsolutions.ipf.core.releaser;

import com.iconsolutions.ipf.core.shared.domain.context.UnitOfWorkId;
import lombok.Builder;
import lombok.Data;
import lombok.NonNull;

import java.time.Instant;

/**
 * Holds info about the processing status of a single payment instruction and all payment transactions related to it.
 * <p>
 * For each instruction we track:
 * <br> - general processing status for the instruction and Action type, and
 * <br> - UnitOfWorkId of the last payment transaction being successfully processed, for this payment instruction and Action type
 */
@Data
@Builder(toBuilder = true)
public class ExecutionInfo {

    /**
     * UnitOfWorkId of the payment instruction
     */
    @NonNull
    private final UnitOfWorkId unitOfWorkId;

    /**
     * UnitOfWorkId of the last (instruction-related) payment transaction being successfully processed
     */
    private final UnitOfWorkId offset;

    /**
     * Processing status for the instruction and Action type
     */
    private final Status status;

    /**
     * Holds data for processing payments that is not related to the tracking of the execution.
     */
    @NonNull
    private final PaymentHandlingInfo paymentHandlingInfo;

    /**
     * TTL represents time in seconds after which the record will expire.
     * This field is unique to Azure CosmosDB (must be an int named "ttl")
     */
    private Integer ttl;
    /**
     * Represents the exact instant when this record is eligible for deletion.
     * MongoDB requires a field to be a date type.
     */
    private Instant expiryDate;

    public enum Status {
        PENDING_START,
        IN_PROGRESS,
        FAILURE,
        COMPLETE;
    }

}

MongoDB implementación

`ExecutionInfoStore`la interfaz define 2 métodos separados:

  • Mono<ExecutionInfo> save(ExecutionInfo executionInfo)

  • Mono<ExecutionInfo> findByUnitOfWorkIdAndActionType(UnitOfWorkId id, String actionType)

y es implementado por MongoExecutionInfoStore, utilizando MongoDB base de datos para almacenar y recuperar información de procesamiento.