Package cern.nxcals.api.ingestion.retry
Interface BackupStrategy<T>
-
- Type Parameters:
T
- - the type of the messages supported by the strategy
public interface BackupStrategy<T>
Backup Strategy for the rejected messages. It takes care of storing messages outside of the publisher jvm as well as restoring them for further processing once the underlying problems are solved. All the backup specific details such external storage location etc. should be left to the implementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
BackupStrategy.DataPartition<T>
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.lang.Void>
backup(T message)
Backups the given messagevoid
markAsRestored(BackupStrategy.DataPartition<T> partition)
Marks a given partition as restored i.e.java.util.List<BackupStrategy.DataPartition<T>>
restore()
Restores data from the backup
-
-
-
Method Detail
-
backup
java.util.concurrent.CompletableFuture<java.lang.Void> backup(T message)
Backups the given message- Parameters:
message
- - to be stored in the backup- Returns:
-
restore
java.util.List<BackupStrategy.DataPartition<T>> restore()
Restores data from the backup- Returns:
- list of restored data partitions
-
markAsRestored
void markAsRestored(BackupStrategy.DataPartition<T> partition)
Marks a given partition as restored i.e. successfully send to NXCALS- Parameters:
partition
- - restored partition
-
-