Class OutboxRepository

java.lang.Object
one.tomorrow.transactionaloutbox.repository.OutboxRepository

@Repository public class OutboxRepository extends Object
  • Constructor Details

    • OutboxRepository

      public OutboxRepository(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
  • Method Details

    • persist

      public void persist(OutboxRecord record)
    • updateProcessed

      @Transactional public void updateProcessed(Long id, Instant processed)
    • getUnprocessedRecords

      public List<OutboxRecord> getUnprocessedRecords(int limit)
      Return all records that have not yet been processed (i.e. that do not have the "processed" timestamp set).
      Parameters:
      limit - the max number of records to return
      Returns:
      the requested records, sorted by id ascending
    • deleteOutboxRecordByProcessedNotNullAndProcessedIsBefore

      @Transactional public int deleteOutboxRecordByProcessedNotNullAndProcessedIsBefore(Instant deleteOlderThan)
      Delete processed records older than defined point in time
      Parameters:
      deleteOlderThan - the point in time until the processed entities shall be kept
      Returns:
      amount of deleted rows