Documentation for a newer release is available. View Latest

Storing Execution Information

Payment Releaser keeps track about releasing progress, for Payment Instruction being released. This provides a observability, and more importantly, a resume point in case of any unexpected errors.

Execution Info

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

package com.iconsolutions.ipf.core.releaser;

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

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

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

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

    /**
     * status of the releasing process for the instruction
     */
    private final Status status;

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

MongoDB implementation

ReleaserStore interface defines 2 separate methods:

  • Mono<ExecutionInfo> save(ExecutionInfo releaserExecutionInfo)

  • Mono<ExecutionInfo> findById(UnitOfWorkId id)

and is implemented by MongoReleaserStore, using MongoDB database for storing and retrieving release execution information.