Documentation for a newer release is available. View Latest
Esta página no está disponible actualmente en Español. Si lo necesita, póngase en contacto con el servicio de asistencia de Icon (correo electrónico)

Storing Execution Information

Payment Entries Executor keeps track of progress for Payment Instruction being processed. This provides observability, and more importantly, a resume point in case of any unexpected errors.

Execution Info

Domain entity holding the information about processing of the specific instruction is defined in the following way:

package com.iconsolutions.ipf.core.releaser;

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

/**
 * 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 {

    public ExecutionInfo(@NonNull UnitOfWorkId unitOfWorkId,  ProcessingActionType actionType, UnitOfWorkId offset, Status status, SupportingContext supportingData) {
        this.unitOfWorkId = unitOfWorkId;
        this.actionType = actionType;
        this.offset = offset;
        this.status = status;
        this.supportingData = supportingData;
    }

    public ExecutionInfo(@NonNull UnitOfWorkId unitOfWorkId, UnitOfWorkId offset, Status status) {
        this(unitOfWorkId, offset, status, SupportingContext.empty());
    }

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

    private final ProcessingActionType actionType;

    /**
     * UnitOfWorkId of the last (instruction related) payment transaction being successfully released for execution
     */
    private final UnitOfWorkId offset;

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

    /**
     * Holds supporting contextual information of the instruction.
     * It is not used within the processing and is passed through to downstream operators.
     */
    private final SupportingContext supportingData;

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

MongoDB implementation

ExecutionInfoStore interface defines 2 separate methods:

  • Mono<ExecutionInfo> save(ExecutionInfo executionInfo)

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

and is implemented by MongoExecutionInfoStore, using MongoDB database for storing and retrieving processing information.